LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 872 - Combine analyze and opt tools
Summary: Combine analyze and opt tools
Status: RESOLVED FIXED
Alias: None
Product: tools
Classification: Unclassified
Component: analyze (show other bugs)
Version: 1.0
Hardware: All All
: P normal
Assignee: Reid Spencer
URL:
Keywords: build-problem, code-cleanup
Depends on:
Blocks:
 
Reported: 2006-08-07 15:59 PDT by Reid Spencer
Modified: 2010-03-06 14:05 PST (History)
1 user (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Reid Spencer 2006-08-07 15:59:23 PDT
The "opt" tool already links in most of the analysis passes which makes the
analysis tool somewhat redundant and chewing up significant disk space.  We
should combine the features of "analyze" into "opt", possibly by adding to opt a
new option, "--analyze" which would invoke the printing behaviors of the
exisiting analyze tool.

Making this change will reduce LLVM's footprint significantly since analyze is
one of the largest tools in LLVM.
Comment 1 Reid Spencer 2006-08-18 01:35:57 PDT
Mine.
Comment 2 Reid Spencer 2006-08-18 01:40:00 PDT
This change has been made. To get the old analyze functionality pass
the -analyze option to opt. Note that the integeration here is dead
simple. The "main" of analyze was just copied to opt and invoked if the
-analyze option was given. There may be opportunities for further
integration such as removing the distinction between transform passes
and analysis passes.

To use the analysis functionality, if you previously did this:
  analyze $FNAME -domset -disable-verify
you would now do this:
  opt -analyze $FNAME -domset -disable-verify
Pretty simple.

The main patches involved (excluding all the updates to the Regression tests):
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20060814/036847.html
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20060814/036850.html
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20060814/036851.html

Comment 3 Reid Spencer 2006-08-18 01:41:11 PDT
Exercises for the future:

(1) Allow opt to invoke both the analysis and optimization behaviors at the same
time. Currently this isn't possible.

(2) Remove the distinction between Analysis and Transform passes.
Comment 4 Reid Spencer 2006-08-18 04:53:53 PDT
FYI,

The disk savings (DEBUG build):

Tool      Before        After
analyze   39,739,826    0
opt       69,575,694    72,737,404

Net Savings: 36,578,116