summaryrefslogtreecommitdiff
path: root/lib/Transforms
Commit message (Collapse)AuthorAge
* Remove trailing whitespaceMisha Brukman2005-04-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21427 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug where we would not promote calls to invokes if they occured inChris Lattner2005-04-21
| | | | | | | the same block as the setjmp. Thanks to Greg Pettyjohn for noticing this! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21403 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve doxygen documentation, patch contributed by Evan Jones!Chris Lattner2005-04-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21393 91177308-0d34-0410-b5e6-96231b3b80d8
* Instcombine this:Chris Lattner2005-04-21
| | | | | | | | | | | | | | | | | | %shortcirc_val = select bool %tmp.1, bool true, bool %tmp.4 ; <bool> [#uses=1] %tmp.6 = cast bool %shortcirc_val to int ; <int> [#uses=1] into this: %shortcirc_val = or bool %tmp.1, %tmp.4 ; <bool> [#uses=1] %tmp.6 = cast bool %shortcirc_val to int ; <int> [#uses=1] not this: %tmp.4.cast = cast bool %tmp.4 to int ; <int> [#uses=1] %tmp.6 = select bool %tmp.1, int 1, int %tmp.4.cast ; <int> [#uses=1] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21389 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach simplifycfg that setcc is cheap and non-trapping, so that it canChris Lattner2005-04-21
| | | | | | | | | | | | | | | | | | | | | | | | convert this: %tmp.1 = seteq int %i, 0 ; <bool> [#uses=1] br bool %tmp.1, label %shortcirc_done, label %shortcirc_next shortcirc_next: ; preds = %entry %tmp.4 = seteq int %j, 0 ; <bool> [#uses=1] br label %shortcirc_done shortcirc_done: ; preds = %shortcirc_next, %entry %shortcirc_val = phi bool [ %tmp.4, %shortcirc_next ], [ true, %entry ] ; <bool> [#uses=1] to this: %tmp.1 = seteq int %i, 0 ; <bool> [#uses=1] %tmp.4 = seteq int %j, 0 ; <bool> [#uses=1] %shortcirc_val = select bool %tmp.1, bool true, bool %tmp.4 ; <bool> [#uses=1] ... which is later simplified by instcombine into an or. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21388 91177308-0d34-0410-b5e6-96231b3b80d8
* Wrap some long lines.Chris Lattner2005-04-19
| | | | | | | | | Make IPSCCP strip off dead constant exprs that are using functions, making them appear as though their address is taken. This allows us to propagate some more pool descriptors, lowering the overhead of pool alloc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21363 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate a broken transformation, fixing PR548Chris Lattner2005-04-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21354 91177308-0d34-0410-b5e6-96231b3b80d8
* silence a bogus warningChris Lattner2005-04-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21320 91177308-0d34-0410-b5e6-96231b3b80d8
* a new simple pass, which will be extended to be more useful in the future.Chris Lattner2005-04-15
| | | | | | | | | | This pass forward branches through conditions when it can show that the conditions is either always true or false for a predecessor. This currently only handles the most simple cases of this, but is successful at threading across 2489 branches and 65 switch instructions in 176.gcc, which isn't bad. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21306 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of this for_each loopChris Lattner2005-04-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21253 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug: InstCombine/2005-05-07-UDivSelectCrash.llChris Lattner2005-04-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21152 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement the following xforms:Chris Lattner2005-04-07
| | | | | | | | | (X-Y)-X --> -Y A + (B - A) --> B (B - A) + A --> B git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21138 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement InstCombine/add.ll:test28, transforming C1-(X+C2) --> (C1-C2)-X.Chris Lattner2005-04-07
| | | | | | | | This occurs several dozen times in specint2k, particularly in crafty and gcc apparently. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21136 91177308-0d34-0410-b5e6-96231b3b80d8
* Transform X-(X+Y) == -Y and X-(Y+X) == -YChris Lattner2005-04-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21134 91177308-0d34-0410-b5e6-96231b3b80d8
* disable this transformation in the one obscure case that really pessimizesChris Lattner2005-03-29
| | | | | | | pointer analysis. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20916 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename createPromoteMemoryToRegister() toAlkis Evlogimenos2005-03-28
| | | | | | | | createPromoteMemoryToRegisterPass() to be consistent with other pass creation functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20885 91177308-0d34-0410-b5e6-96231b3b80d8
* Enhance loopsimplify to preserve alias analysis instead of clobbering it.Chris Lattner2005-03-25
| | | | | | | This prevents crashes on some programs when using -ds-aa -licm. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20831 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug where LICM was not updating AA information properly when sinkingChris Lattner2005-03-25
| | | | | | | a pointer value out of a loop causing it to be duplicated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20828 91177308-0d34-0410-b5e6-96231b3b80d8
* enable -debug-only=licmChris Lattner2005-03-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20788 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the missing symbols problem Bill was hitting. Patch contributed byChris Lattner2005-03-17
| | | | | | | Bill Wendling!! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20649 91177308-0d34-0410-b5e6-96231b3b80d8
* stop using method.Chris Lattner2005-03-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20603 91177308-0d34-0410-b5e6-96231b3b80d8
* This mega patch converts us from using Function::a{iterator|begin|end} toChris Lattner2005-03-15
| | | | | | | | | using Function::arg_{iterator|begin|end}. Likewise Module::g* -> Module::global_*. This patch is contributed by Gabor Greif, thanks! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20597 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a bug where we thought arguments were constants :(Chris Lattner2005-03-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20506 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Regression/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll,Chris Lattner2005-03-06
| | | | | | | hopefully not breaking too many other things. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20505 91177308-0d34-0410-b5e6-96231b3b80d8
* implement Transforms/LoopStrengthReduce/invariant_value_first_arg.llChris Lattner2005-03-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20501 91177308-0d34-0410-b5e6-96231b3b80d8
* minor simplifications of the code.Chris Lattner2005-03-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20497 91177308-0d34-0410-b5e6-96231b3b80d8
* trivial simplificationChris Lattner2005-03-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20494 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug where we could corrupt a parent loop's header info if we unrolledChris Lattner2005-03-06
| | | | | | | | a nested loop. This fixes Transforms/LoopUnroll/2005-03-06-BadLoopInfoUpdate.ll and PR532 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20493 91177308-0d34-0410-b5e6-96231b3b80d8
* Make this MUCH faster by avoiding a linear search in the symbol table code.Chris Lattner2005-03-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20479 91177308-0d34-0410-b5e6-96231b3b80d8
* Reformat comments to fix 80 columns.Jeff Cohen2005-03-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20467 91177308-0d34-0410-b5e6-96231b3b80d8
* Reuse induction variables created for strength-reduced GEPs by other similar ↵Jeff Cohen2005-03-05
| | | | | | GEPs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20466 91177308-0d34-0410-b5e6-96231b3b80d8
* second argument to Value::setName is now gone.Chris Lattner2005-03-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20463 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not compute 1ULL << 64, which is undefined. This fixes Ptrdist/ks on theChris Lattner2005-03-04
| | | | | | | sparc, and testcase Regression/Transforms/InstCombine/2005-03-04-ShiftOverflow.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20445 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for not strength reducing GEPs where the element size is a smallJeff Cohen2005-03-04
| | | | | | | power of two. This emphatically includes the zeroeth power of two. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20429 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an optional argument to lower to a specific constant value instead ofChris Lattner2005-03-03
| | | | | | | to a "sizeof" expression. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20414 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed the following LSR bugs:Jeff Cohen2005-03-01
| | | | | | | | | | | | | | | | * Loop invariant code does not dominate the loop header, but rather the end of the loop preheader. * The base for a reduced GEP isn't a constant unless all of its operands (preceding the induction variable) are constant. * Allow induction variable elimination for the simple case after all. Also made changes recommended by Chris for properly deleting instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20383 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix crash in LSR due to attempt to remove original induction variable. However,Jeff Cohen2005-02-28
| | | | | | | | for reasons explained in the comments, I also deactivated this code as it needs more thought. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20367 91177308-0d34-0410-b5e6-96231b3b80d8
* PHI nodes were incorrectly placed when more than one GEP is reduced in a loop.Jeff Cohen2005-02-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20360 91177308-0d34-0410-b5e6-96231b3b80d8
* First pass at improved Loop Strength Reduction. Still not yet ready for ↵Jeff Cohen2005-02-27
| | | | | | prime time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20358 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach globalopt how memset/cpy/move affect memory, to allow better optimization.Chris Lattner2005-02-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20352 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix spelling, patch contributed by Gabor Greif!Chris Lattner2005-02-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20343 91177308-0d34-0410-b5e6-96231b3b80d8
* remove extraneous castChris Lattner2005-02-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20334 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement Transforms/SimplifyCFG/switch_thread.llChris Lattner2005-02-24
| | | | | | | | | This does a simple form of "jump threading", which eliminates CFG edges that are provably dead. This triggers 90 times in the external tests, and eliminating CFG edges is always always a good thing! :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20300 91177308-0d34-0410-b5e6-96231b3b80d8
* make this more efficient. Scan up to 16 nodes, not the whole list.Chris Lattner2005-02-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20289 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove use of bind_objChris Lattner2005-02-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20276 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not mark obviously unreachable blocks live when processing PHI nodes,Chris Lattner2005-02-17
| | | | | | | | | | | | | and handle incomplete control dependences correctly. This fixes: Regression/Transforms/ADCE/dead-phi-edge.ll -> a missed optimization Regression/Transforms/ADCE/dead-phi-edge.ll -> a compiler crash distilled from QT4 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20227 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the second bug attached to PR504.Chris Lattner2005-02-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20181 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix for testcase Transforms/IndVarsSimplify/2005-02-11-InvokeCrash.llChris Lattner2005-02-12
| | | | | | | and PR504. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20129 91177308-0d34-0410-b5e6-96231b3b80d8
* Localize globals if they are only used in main(). This replaces theAlkis Evlogimenos2005-02-10
| | | | | | | | global with an alloca, which eventually gets promoted into a register. This enables a lot of other optimizations later on. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20109 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix crash on MallocInsts of unsized types.Alkis Evlogimenos2005-02-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19988 91177308-0d34-0410-b5e6-96231b3b80d8