Commit Graph

374 Commits

Author SHA1 Message Date
Chris Lattner
48c1bc7b3a Implement new -debug-pass=Arguments option that causes PassManager to
print out the command line options for the optimizations it is running.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3165 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 19:51:02 +00:00
Chris Lattner
c188eeb08c Cleanup ConstantExpr handling:
* Correctly delete TypeHandles in AsmParser.  In addition to not leaking
   memory, this prevents a bug that could have occurred when a type got
   resolved that the constexpr was using
 * Check for errors in the AsmParser instead of hitting assertion failures
   deep in the code
 * Simplify the interface to the ConstantExpr class, removing unneccesary
   parameters to the ::get* methods.
 * Rename the 'getelementptr' version of ConstantExpr::get to
   ConstantExpr::getGetElementPtr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3161 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 18:54:25 +00:00
Chris Lattner
e8e4605021 Cleanup ConstantExpr handling:
* Correctly delete TypeHandles in AsmParser.  In addition to not leaking
   memory, this prevents a bug that could have occurred when a type got
   resolved that the constexpr was using
 * Check for errors in the AsmParser instead of hitting assertion failures
   deep in the code
 * Simplify the interface to the ConstantExpr class, removing unneccesary
   parameters to the ::get* methods.
 * Rename the 'getelementptr' version of ConstantExpr::get to
   ConstantExpr::getGetElementPtr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3160 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 18:54:22 +00:00
Chris Lattner
ad772a7188 Remove FIXME's that aren't really needed after all.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3158 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 16:38:54 +00:00
Chris Lattner
17689dfe24 Declare that these passes only depend on the CFG of the function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3157 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 16:27:52 +00:00
Chris Lattner
37d66c4dea * Move some code from Pass.cpp to PassManagerT.h
* Implement stuff so that code can declare that they only depend on the CFG of
  a function, not on anything else.  This speeds up GCCAS a lot.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3155 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 16:27:02 +00:00
Chris Lattner
5fa829c54a Implement constant propogation of logical (and, or, xor) expressions.
Fixes testcase: test/Regression/Transforms/ConstProp/logicaltest.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3154 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 16:24:28 +00:00
Chris Lattner
e56096aa41 Implement constant propogation of logical (and, or, xor) expressions.
Fixes testcase: test/Regression/Transforms/ConstProp/logicaltest.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3153 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 16:24:25 +00:00
Chris Lattner
d472e47b6c * Eliminate the Provided set. All Passes now finally just automatically
provide themselves.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3125 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-29 21:03:38 +00:00
Chris Lattner
eb702350f7 * Eliminate the Provided set. All Passes now finally just automatically
provide themselves.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3124 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-29 21:03:33 +00:00
Chris Lattner
44050fb25a * PassInfo is allowed to be missing now (ie, not all passes need be registered)
* getPassName uses PassInfo if it's available
* PassInfo is now cached in the pass so that it is only looked up once, maximum


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3123 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-29 21:02:31 +00:00
Chris Lattner
a59cbb2043 * Standardize how analysis results/passes as printed with the print() virtual
methods
* Eliminate AnalysisID:  Now it is just a typedef for const PassInfo*
* Simplify how AnalysisID's are initialized
* Eliminate Analysis/Writer.cpp/.h: incorporate printing functionality into
  the analyses themselves.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3116 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-27 01:12:17 +00:00
Chris Lattner
a6275ccdf5 * Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
  are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
  are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Remove getPassName implementations from various subclasses


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3113 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-26 21:12:46 +00:00
Chris Lattner
1e43516dcf * Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
  are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
  are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Remove getPassName implementations from various subclasses


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3112 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-26 21:12:44 +00:00
Chris Lattner
ce6ef112c4 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3105 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-26 18:40:14 +00:00
Chris Lattner
c1b2718acf Fix typeo that caused bug:
test/Regression/Assembler/2002-07-25-ReturnPtrFunction.llx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3103 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-25 20:58:51 +00:00
Chris Lattner
54d10c8715 Fix bug: test/Regression/Assembler/2002-07-25-QuoteInString.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3099 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-25 20:32:37 +00:00
Chris Lattner
b2e80a6951 Avoid warning: control reaches end of non-void function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3081 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-25 15:39:05 +00:00
Chris Lattner
b1443b1749 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3072 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-24 22:40:39 +00:00
Chris Lattner
fe8041ae39 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3065 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-24 22:08:53 +00:00
Chris Lattner
e20a5dd343 Register Verifier pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3019 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-23 18:08:17 +00:00
Chris Lattner
54bbdb4677 Add support for pass registration
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3018 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-23 18:08:00 +00:00
Chris Lattner
f082b80828 Register Writer passes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3017 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-23 18:07:49 +00:00
Chris Lattner
56d27019e6 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3002 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-23 17:52:38 +00:00
Chris Lattner
5ff62e90d0 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2985 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-22 02:10:13 +00:00
Chris Lattner
e306d94782 * Rewrite loop to be slightly more efficient (arguably)
* Fix a MAJOR thinko that was causing bad links to happen on Spec


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2953 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 02:31:03 +00:00
Chris Lattner
6183b92b2c * ConstExpr::getelementptr now takes a vector of Constants not Values
* Assert things instead of printing an error and returning null.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2949 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 00:14:50 +00:00
Chris Lattner
3535c9b387 Add a hack to check for a subset of true dominance properties
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2947 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 00:13:42 +00:00
Chris Lattner
6cdf1971bd Implement linking of ConstExprs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2946 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 00:13:08 +00:00
Anand Shukla
4d2da0d7a7 added std:: to cerr and endl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2914 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-16 00:02:17 +00:00
Vikram S. Adve
d0b1bb01f2 Ensure ConstExpr constants are unique using a
map of <opcode, operands> to ConstExpr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2909 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-15 18:19:33 +00:00
Vikram S. Adve
b4dbb4445c Added support to write out ConstantExpr nodes.
Also, avoid asserting out when writing out an invalid tree
since the assembly writer is used when debugging.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2902 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-14 23:14:45 +00:00
Vikram S. Adve
345e0cfb86 Added subclass ConstantExpr to represent expressions consructed from
constants using operators such as cast, getelementptr, add, shl, etc.
Note that a ConstantExpr can be of any type, so classof() in most
other subclasses (that discriminate by type) have to check that it
is also not a ConstantExpr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2901 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-14 23:13:17 +00:00
Vikram S. Adve
c105645c16 Create a static version of Instruction::getOpcodeName(opCode) that
can be invoked with only an opcode (i.e., without an instruction).
Move all opCode->opCodeName translations there.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2900 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-14 23:09:40 +00:00
Chris Lattner
607dc6880e *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2852 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-10 16:48:17 +00:00
Vikram S. Adve
08272fbdb2 Moved MachineCodeForBB to be an annotation on BasicBlock.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2818 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 22:31:11 +00:00
Chris Lattner
3e009942ed *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2813 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-30 16:25:25 +00:00
Anand Shukla
d05e22cb6f changes for 64bit gcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2801 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 22:07:38 +00:00
Anand Shukla
60a786e9e9 added include<iostream> for cerr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2800 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 22:04:00 +00:00
Chris Lattner
7e70829632 MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2779 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 16:13:24 +00:00
Chris Lattner
18961504fc *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2777 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 16:12:52 +00:00
Chris Lattner
24e845fa95 * Update to work with Megapatch
* Add two new checks:
  * PHI nodes must be the first thing in a basic block, all grouped together
  * All basic blocks should only end with terminator insts, not contain them


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2773 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 15:56:27 +00:00
Chris Lattner
9e77f77687 Support opaque type printing a little bit at least
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2748 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-26 20:17:54 +00:00
Chris Lattner
89d46b0f09 Fix bug: test/Regression/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll
Which contains a description of why this is neccesary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2733 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-23 16:52:34 +00:00
Chris Lattner
0c51266082 Avoid creating the symbol table if we don't need it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2728 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 22:53:05 +00:00
Chris Lattner
68e0278815 Print out function name with % style instead of "" style
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2726 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 22:29:26 +00:00
Chris Lattner
87a09b10f8 Fix bug: test/Regression/Transforms/CFGSimplify/2002-05-21-PHIElimination.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2694 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-21 19:52:49 +00:00
Chris Lattner
afc38686b4 Avoid emitting a useless comment for a basic block with no uses (which
often happens for the entry basic block of a function)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2624 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-14 16:02:05 +00:00
Chris Lattner
ef704a23b4 Add method to check to see if two _Instructions_ dominate each other
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2616 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-13 22:03:16 +00:00
Chris Lattner
d6b60805e8 We actually need this code for the release build to prevent link errors,
un#ifdef it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2606 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-10 18:54:35 +00:00