summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Implement stripping of debug symbols, making the --strip-debug options inChris Lattner2004-12-031-2/+82
| | | | | | gccas/gccld more than just a noop. llvm-svn: 18456
* Initial reimplementation of the -strip pass, with a stub for implementingChris Lattner2004-12-021-0/+68
| | | | | | -S llvm-svn: 18440
* This pass is moving to lib IPOChris Lattner2004-12-021-56/+0
| | | | llvm-svn: 18439
* Implement a FIXME by checking to make sure that a malloc is not being usedChris Lattner2004-12-021-3/+25
| | | | | | | | | in scary and unknown ways before we promote it. This fixes the miscompilation of 188.ammp that has been plauging us since a globalopt patch went in. Thanks a ton to Tanya for helping me diagnose the problem! llvm-svn: 18418
* Fix a minor bug where we set a var to initialized on malloc, not on store.Chris Lattner2004-12-021-10/+17
| | | | | | This doesn't fix anything that I'm aware of, just noticed it by inspection llvm-svn: 18417
* This pass is completely broken.Chris Lattner2004-11-301-11/+4
| | | | llvm-svn: 18387
* Squelch warningChris Lattner2004-11-301-1/+1
| | | | llvm-svn: 18381
* Fix test/Regression/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.llxChris Lattner2004-11-301-0/+2
| | | | | | This only fails on darwin or on X86 under valgrind. llvm-svn: 18377
* Alkis noticed that this variable is dead. Thanks!Chris Lattner2004-11-301-2/+0
| | | | llvm-svn: 18369
* If we have something like this:Chris Lattner2004-11-301-0/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | if (x) { code ... } else { code ... } Turn it into: code if (x) { ... } else { ... } This reduces code size and in some common cases allows us to completely eliminate the conditional. This turns several if/then/else blocks in loops into straightline code in 179.art, turning the loops into single basic blocks (good for modsched even!). Maybe now brg will leave me alone ;-) llvm-svn: 18366
* Allow hoisting loads of globals and alloca's in conditionals.Chris Lattner2004-11-291-0/+6
| | | | llvm-svn: 18363
* Fix for PR454:Reid Spencer2004-11-281-41/+80
| | | | | | | * Make sure we handle signed to unsigned conversion correctly * Move this visitSetCondInst case to its own method. llvm-svn: 18312
* Make DSE potentially more aggressive by being more specific about alloca sizes.Chris Lattner2004-11-281-4/+10
| | | | llvm-svn: 18309
* Implement Regression/Transforms/InstCombine/getelementptr_cast.ll, whichChris Lattner2004-11-271-0/+15
| | | | | | occurs many times in crafty llvm-svn: 18273
* Provide size information when checking to see if we can LICM a load, thisChris Lattner2004-11-261-3/+6
| | | | | | allows us to hoist more loads in some cases. llvm-svn: 18265
* Do not count debugger intrinsics in size estimation.Chris Lattner2004-11-221-2/+6
| | | | llvm-svn: 18110
* Ignore debugger intrinsics when doing inlining size computations.Chris Lattner2004-11-221-1/+2
| | | | llvm-svn: 18109
* Do not consider debug intrinsics in the size computations for loop unrolling.Chris Lattner2004-11-221-0/+3
| | | | | | Patch contributed by Michael McCracken! llvm-svn: 18108
* Allow constructor parameter to override aggregating args; fix spacingMisha Brukman2004-11-201-2/+2
| | | | llvm-svn: 18028
* Fix the exposed prototype for the lower packed pass, thanks toChris Lattner2004-11-191-1/+2
| | | | | | Morten Ofstad. llvm-svn: 17996
* CPR is dead.Chris Lattner2004-11-191-1/+0
| | | | llvm-svn: 17992
* Delete stoppoints that occur for the same source line.Chris Lattner2004-11-181-1/+11
| | | | llvm-svn: 17970
* Check in hook that I forgotChris Lattner2004-11-181-0/+3
| | | | llvm-svn: 17956
* Do not delete dead invoke instructions!Chris Lattner2004-11-161-2/+1
| | | | llvm-svn: 17897
* Remove unused variable for compilation by VC++.Reid Spencer2004-11-151-1/+1
| | | | | | Patch contributed by Morten Ofstad. llvm-svn: 17830
* Minor cleanups. There is no reason for SCCP to derive from instvisitor anymore.Chris Lattner2004-11-151-21/+14
| | | | llvm-svn: 17825
* Count more accuratelyChris Lattner2004-11-151-0/+4
| | | | llvm-svn: 17824
* Quiet warnings on the persephone testerChris Lattner2004-11-151-2/+2
| | | | llvm-svn: 17821
* Two minor improvements:Chris Lattner2004-11-151-13/+37
| | | | | | | | | | | 1. Speedup getValueState by having it not consider Arguments. It's better to just add them before we start SCCP'ing. 2. SCCP can delete the contents of dead blocks. No really, it's ok! This reduces the size of the IR for subsequent passes, even though simplifycfg would do the same job. In practice, simplifycfg does not run until much later than sccp in gccas llvm-svn: 17820
* rename InstValue to LatticeValue, as it holds for more than instructions.Chris Lattner2004-11-151-35/+37
| | | | llvm-svn: 17818
* Substantially refactor the SCCP class into an SCCP pass and an SCCPSolverChris Lattner2004-11-151-167/+208
| | | | | | | | | | | | class. The only changes are minor: * Do not try to SCCP instructions that return void in the rewrite loop. This is silly and fool hardy, wasting a map lookup and adding an entry to the map which is never used. * If we decide something has an undefined value, rewrite it to undef, potentially leading to further simplications. llvm-svn: 17816
* If a global is just loaded and restored, realize that it is not changingChris Lattner2004-11-141-3/+9
| | | | | | | | | | | | | | | | | | | value. This allows us to turn more globals into constants and eliminate them. This patch implements GlobalOpt/load-store-global.llx. Note that this patch speeds up 255.vortex from: Output/255.vortex.out-cbe.time:program 7.640000 Output/255.vortex.out-llc.time:program 9.810000 to: Output/255.vortex.out-cbe.time:program 7.250000 Output/255.vortex.out-llc.time:program 9.490000 Which isn't bad at all! llvm-svn: 17746
* This optimization makes MANY phi nodes that all have the same incoming value.Chris Lattner2004-11-141-7/+23
| | | | | | | | If this happens, detect it early instead of relying on instcombine to notice it later. This can be a big speedup, because PHI nodes can have many incoming values. llvm-svn: 17741
* Implement instcombine/phi.ll:test6 - pulling operations through PHI nodes.Chris Lattner2004-11-141-6/+85
| | | | | | | This exposes subsequent optimization possiblities and reduces code size. This triggers 1423 times in spec. llvm-svn: 17740
* Transform this:Chris Lattner2004-11-141-4/+6
| | | | | | | | | | | | %X = alloca ... %Y = alloca ... X == Y into false. This allows us to simplify some stuff in eon (and probably many other C++ programs) where operator= was checking for self assignment. Folding this allows us to SROA several additional structs. llvm-svn: 17735
* Remove note to selfChris Lattner2004-11-141-4/+0
| | | | llvm-svn: 17734
* If a function always returns a constant, replace all calls sites with thatChris Lattner2004-11-141-11/+80
| | | | | | | | | | | constant value. This makes the return value dead and allows for simplification in the caller. This implements IPConstantProp/return-constant.ll This triggers several dozen times throughout SPEC. llvm-svn: 17730
* Teach SROA how to promote an array index that is variable, if the dimensionChris Lattner2004-11-141-40/+98
| | | | | | | | | of the array is just two. This occurs 8 times in gcc, 6 times in crafty, and 12 times in 099.go. This implements ScalarRepl/sroa_two.ll llvm-svn: 17727
* Rearrange some code, no functionality changes.Chris Lattner2004-11-141-49/+68
| | | | llvm-svn: 17724
* Remove debugging codeChris Lattner2004-11-131-1/+0
| | | | llvm-svn: 17719
* Argument promotion transforms functions to unconditionally load theirChris Lattner2004-11-131-3/+51
| | | | | | | | | | argument pointers. This is only valid to do if the function already unconditionally loaded an argument or if the pointer passed in is known to be valid. Make sure to do the required checks. This fixed ArgumentPromotion/control-flow.ll and the Burg program. llvm-svn: 17718
* Simplify handling of shifts to be the same as we do for adds. Add supportChris Lattner2004-11-131-45/+40
| | | | | | | | | | | | | | | | | | | | | for (X * C1) + (X * C2) (where * can be mul or shl), allowing us to fold: Y+Y+Y+Y+Y+Y+Y+Y into %tmp.8 = shl long %Y, ubyte 3 ; <long> [#uses=1] instead of %tmp.4 = shl long %Y, ubyte 2 ; <long> [#uses=1] %tmp.12 = shl long %Y, ubyte 2 ; <long> [#uses=1] %tmp.8 = add long %tmp.4, %tmp.12 ; <long> [#uses=1] This implements add.ll:test25 Also add support for (X*C1)-(X*C2) -> X*(C1-C2), implementing sub.ll:test18 llvm-svn: 17704
* Fold:Chris Lattner2004-11-131-0/+13
| | | | | | | | | | | | | | | | (X + (X << C2)) --> X * ((1 << C2) + 1) ((X << C2) + X) --> X * ((1 << C2) + 1) This means that we now canonicalize "Y+Y+Y" into: %tmp.2 = mul long %Y, 3 ; <long> [#uses=1] instead of: %tmp.10 = shl long %Y, ubyte 1 ; <long> [#uses=1] %tmp.6 = add long %Y, %tmp.10 ; <long> [#uses=1] llvm-svn: 17701
* Lazily create the abort message, so only translation units that use unwindChris Lattner2004-11-131-22/+31
| | | | | | will actually get it. llvm-svn: 17700
* Fix: CodeExtractor/2004-11-12-InvokeExtract.llChris Lattner2004-11-131-2/+16
| | | | llvm-svn: 17699
* Fix a bug where the code extractor would get a bit confused handling invokeChris Lattner2004-11-121-1/+13
| | | | | | instructions, setting DefBlock to a block it did not have dom info for. llvm-svn: 17697
* Simplify handling of constant initializersChris Lattner2004-11-121-36/+13
| | | | llvm-svn: 17696
* Actually, leave the check in. This prevents us from counting dead argumentsChris Lattner2004-11-111-1/+1
| | | | | | as IPCP opportunities. llvm-svn: 17680
* Fix bug: IPConstantProp/deadarg.llChris Lattner2004-11-111-2/+2
| | | | llvm-svn: 17679
* Make IP Constant prop more aggressive about handling self recursive calls.Chris Lattner2004-11-101-2/+4
| | | | | | This implements IPConstantProp/recursion.ll llvm-svn: 17666
OpenPOWER on IntegriCloud