summaryrefslogtreecommitdiff
path: root/lib/Transforms
Commit message (Collapse)AuthorAge
...
* improve debug outputChris Lattner2005-08-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22638 91177308-0d34-0410-b5e6-96231b3b80d8
* Move from Stage 0 to Stage 1.Chris Lattner2005-08-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only emit one PHI node for IV uses with identical bases and strides (after moving foldable immediates to the load/store instruction). This implements LoopStrengthReduce/dont_insert_redundant_ops.ll, allowing us to generate this PPC code for test1: or r30, r3, r3 .LBB_test1_1: ; Loop li r2, 0 stw r2, 0(r30) stw r2, 4(r30) bl L_pred$stub addi r30, r30, 8 cmplwi cr0, r3, 0 bne .LBB_test1_1 ; Loop instead of this code: or r30, r3, r3 or r29, r3, r3 .LBB_test1_1: ; Loop li r2, 0 stw r2, 0(r29) stw r2, 4(r30) bl L_pred$stub addi r30, r30, 8 ;; Two iv's with step of 8 addi r29, r29, 8 cmplwi cr0, r3, 0 bne .LBB_test1_1 ; Loop git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22635 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename IVUse to IVUsersOfOneStride, use a struct instead of a pair toChris Lattner2005-08-03
| | | | | | | | unify some parallel vectors and get field names more descriptive than "first" and "second". This isn't lisp afterall :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22633 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a nasty dangling pointer issue. The ScalarEvolution pass would keep aChris Lattner2005-08-03
| | | | | | | | | | map from instruction* to SCEVHandles. When we delete instructions, we have to tell it about it. We would run into nasty cases where new instructions were reallocated at old instruction addresses and get the old map values. Bad bad bad :( git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22632 91177308-0d34-0410-b5e6-96231b3b80d8
* The correct fix for PR612, which also fixesChris Lattner2005-08-03
| | | | | | | Transforms/LowerInvoke/2005-08-03-InvokeWithPHIUse.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22628 91177308-0d34-0410-b5e6-96231b3b80d8
* When inserting code, make sure not to insert it before PHI nodes. ThisChris Lattner2005-08-03
| | | | | | | fixes PR612 and Transforms/LowerInvoke/2005-08-03-InvokeWithPHI.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22626 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Transforms/SimplifyCFG/2005-08-03-PHIFactorCrash.ll, a problem thatChris Lattner2005-08-03
| | | | | | | occurred while bugpointing another testcase git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22621 91177308-0d34-0410-b5e6-96231b3b80d8
* Finally, add the required constraint checks to fix ↵Chris Lattner2005-08-03
| | | | | | | | | Transforms/SimplifyCFG/2005-08-01-PHIUpdateFail.ll the right way git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22615 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify some code, add the correct pred checksChris Lattner2005-08-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22613 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor code out of PropagatePredecessorsForPHIs, turning it into a pure ↵Chris Lattner2005-08-03
| | | | | | function with no side-effects git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22612 91177308-0d34-0410-b5e6-96231b3b80d8
* use splice instead of remove/insert to avoid some symtab operationsChris Lattner2005-08-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22611 91177308-0d34-0410-b5e6-96231b3b80d8
* move two functions up in the file, use SafeToMergeTerminators to eliminateChris Lattner2005-08-03
| | | | | | | some duplicated code git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22610 91177308-0d34-0410-b5e6-96231b3b80d8
* Rip some code out of the main SimplifyCFG function into a subfunction andChris Lattner2005-08-03
| | | | | | | call it from the only place it is live. No functionality changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22609 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable this patch:Chris Lattner2005-08-02
| | | | | | | | | | http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050801/027345.html This breaks real programs and only fixes an obscure regression testcase. A real fix is in development. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22606 91177308-0d34-0410-b5e6-96231b3b80d8
* Change a place to use an arbitrary value instead of null, when possibleChris Lattner2005-08-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22605 91177308-0d34-0410-b5e6-96231b3b80d8
* Update to use the new MathExtras.h support for log2 computation.Chris Lattner2005-08-02
| | | | | | | Patch contributed by Jim Laskey! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22592 91177308-0d34-0410-b5e6-96231b3b80d8
* Like the comment says, do not insert cast instructions before phi nodesChris Lattner2005-08-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22586 91177308-0d34-0410-b5e6-96231b3b80d8
* This code was very close, but not quite right. It did not take intoChris Lattner2005-08-02
| | | | | | | | | consideration the case where a reference in an unreachable block could occur. This fixes Transforms/SimplifyCFG/2005-08-01-PHIUpdateFail.ll, something I ran into while bugpoint'ing another pass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22584 91177308-0d34-0410-b5e6-96231b3b80d8
* add a comment, make a check more lenientChris Lattner2005-08-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22581 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify for loop, clear a per-loop map after processing each loopChris Lattner2005-08-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22580 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a commentChris Lattner2005-08-02
| | | | | | | | Make LSR ignore GEP's that have loop variant base values, as we currently cannot codegen them git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22576 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an iterator invalidation problemChris Lattner2005-08-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22575 91177308-0d34-0410-b5e6-96231b3b80d8
* ConstantInt::get only works for arguments < 128.Chris Lattner2005-08-01
| | | | | | | | | | | SimplifyLibCalls probably has to be audited to make sure it does not make this mistake elsewhere. Also, if this code knows that the type will be unsigned, obviously one arm of this is dead. Reid, can you take a look into this further? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22566 91177308-0d34-0410-b5e6-96231b3b80d8
* Keep tabs and trailing spaces out.Jeff Cohen2005-07-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22565 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix VC++ build problems.Jeff Cohen2005-07-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22564 91177308-0d34-0410-b5e6-96231b3b80d8
* Ack, typoNate Begeman2005-07-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22560 91177308-0d34-0410-b5e6-96231b3b80d8
* Commit a new LoopStrengthReduce pass that can use scalar evolutions andNate Begeman2005-07-30
| | | | | | | | | target data to decide which loop induction variables to strength reduce and how to do so. This work is mostly by Chris Lattner, with tweaks by me to get it working on some of MultiSource. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22558 91177308-0d34-0410-b5e6-96231b3b80d8
* Break SCEVExpander out of IndVarSimplify into its own .h/.cpp file so thatNate Begeman2005-07-30
| | | | | | | other passes may use it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22557 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate all remaining tabs and trailing spaces.Jeff Cohen2005-07-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22523 91177308-0d34-0410-b5e6-96231b3b80d8
* ConvertibleToGEP always returns 0, remove some old crufty code whichChris Lattner2005-07-26
| | | | | | | is actually dead because of this! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22515 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not let MaskedValueIsZero consider undef to be zero, for reasonsChris Lattner2005-07-20
| | | | | | | | | explained in the comment. This fixes UnitTests/2003-09-18-BitFieldTest on darwin git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22483 91177308-0d34-0410-b5e6-96231b3b80d8
* When transforming &A[i] < &A[j] -> i < j, make sure to perform the comparisonChris Lattner2005-07-18
| | | | | | | as a signed compare. This patch may fix PR597, but is correct in any case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22465 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a problem that instcombine would hit when dealing with unreachable code.Chris Lattner2005-07-07
| | | | | | | | | | Because the instcombine has to scan the entire function when it starts up to begin with, we might as well do it in DFO so we can nuke unreachable code. This fixes: Transforms/InstCombine/2005-07-07-DeadPHILoop.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22348 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR590 and Transforms/Mem2Reg/2005-06-30-ReadBeforeWrite.ll.Chris Lattner2005-06-30
| | | | | | | | | The optimization for locally used allocas was not safe for allocas that were read before they were written. This change disables that optimization in that case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22318 91177308-0d34-0410-b5e6-96231b3b80d8
* Doh! Forgot to LLVMify the style.John Criswell2005-06-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22312 91177308-0d34-0410-b5e6-96231b3b80d8
* Basic fix for PR#591; don't convert an fprintf() to an fwrite() if thereJohn Criswell2005-06-29
| | | | | | | | | | is a mismatch in their character type pointers (i.e. fprintf() prints an array of ubytes while fwrite() takes an array of sbytes). We can probably do better than this (such as casting the ubyte to an sbyte). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22310 91177308-0d34-0410-b5e6-96231b3b80d8
* add a debug typeChris Lattner2005-06-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22277 91177308-0d34-0410-b5e6-96231b3b80d8
* prevent va_arg from being hoisted from a loopAndrew Lenharth2005-06-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22265 91177308-0d34-0410-b5e6-96231b3b80d8
* prevent DCE of vaarg intrinsics. This should take care of most regressionsAndrew Lenharth2005-06-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22263 91177308-0d34-0410-b5e6-96231b3b80d8
* core changes for varargsAndrew Lenharth2005-06-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22254 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a problem with the strcmp optimization checking the wrong string andReid Spencer2005-06-18
| | | | | | | not casting to the correct type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22250 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up some uninitialized variables and missing return statements thatReid Spencer2005-06-18
| | | | | | | GCC 4.0.0 compiler (sometimes incorrectly) warns about under release build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22249 91177308-0d34-0410-b5e6-96231b3b80d8
* This is not true: (X != 13 | X < 15) -> X < 15Chris Lattner2005-06-17
| | | | | | | | It is actually always true. This fixes PR586 and Transforms/InstCombine/2005-06-16-SetCCOrSetCCMiscompile.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22236 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't crash when dealing with INTMIN. This fixes PR585 andChris Lattner2005-06-17
| | | | | | | Transforms/InstCombine/2005-06-16-RangeCrash.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22234 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't crash on: X = phi (X, X).Chris Lattner2005-06-17
| | | | | | | This fixes PR584 and Transforms/SimplifyCFG/2005-06-16-PHICrash.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22232 91177308-0d34-0410-b5e6-96231b3b80d8
* avoid constructing out of range shift amounts.Chris Lattner2005-06-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22230 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR583 and testcase Transforms/InstCombine/2005-06-15-DivSelectCrash.llChris Lattner2005-06-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22227 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR571, removing code that does just the WRONG thing :)Chris Lattner2005-06-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22225 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in my previous patch. Do not get the shift amount type (whichChris Lattner2005-06-16
| | | | | | | is always ubyte, get the type being shifted). This unbreaks espresso git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22224 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR575, patch provided by John Mellor-Crummey. Thanks!Chris Lattner2005-06-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22223 91177308-0d34-0410-b5e6-96231b3b80d8