summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
Commit message (Collapse)AuthorAgeFilesLines
* DEBUG got moved to Support/Debug.hChris Lattner2003-08-019-5/+14
| | | | llvm-svn: 7492
* Instcombine: (A >> c1) << c2 for signed integersChris Lattner2003-07-241-10/+12
| | | | llvm-svn: 7295
* Reorganization of code, no functional changes.Chris Lattner2003-07-241-47/+48
| | | | | | Now it shoudl be a bit more efficient llvm-svn: 7292
* Allow folding several instructions into casts, which can simplify a lotChris Lattner2003-07-241-7/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of codes. For example, short kernel (short t1) { t1 >>= 8; t1 <<= 8; return t1; } became: short %kernel(short %t1.1) { %tmp.3 = shr short %t1.1, ubyte 8 ; <short> [#uses=1] %tmp.5 = cast short %tmp.3 to int ; <int> [#uses=1] %tmp.7 = shl int %tmp.5, ubyte 8 ; <int> [#uses=1] %tmp.8 = cast int %tmp.7 to short ; <short> [#uses=1] ret short %tmp.8 } before, now it becomes: short %kernel(short %t1.1) { %tmp.3 = shr short %t1.1, ubyte 8 ; <short> [#uses=1] %tmp.8 = shl short %tmp.3, ubyte 8 ; <short> [#uses=1] ret short %tmp.8 } which will become: short %kernel(short %t1.1) { %tmp.3 = and short %t1.1, 0xFF00 ret short %tmp.3 } This implements cast-set.ll:test4 and test5 llvm-svn: 7290
* Add commentsChris Lattner2003-07-231-0/+9
| | | | llvm-svn: 7283
* Remove explicit check for: not (not X) = X, it is already handled because ↵Chris Lattner2003-07-231-10/+16
| | | | | | | | | xor is commutative - InstCombine: (X & C1) ^ C2 --> (X & C1) | C2 iff (C1&C2) == 0 - InstCombine: (X | C1) ^ C2 --> (X | C1) & ~C2 iff (C1&C2) == C2 llvm-svn: 7282
* InstCombine: (X ^ C1) & C2 --> (X & C2) iff (C1&C2) == 0Chris Lattner2003-07-231-9/+11
| | | | llvm-svn: 7272
* - InstCombine: (X | C1) & C2 --> X & C2 iff C1 & C1 == 0Chris Lattner2003-07-231-10/+33
| | | | | | | - InstCombine: (X | C) & C --> C - InstCombine: (X | C1) & C2 --> (X | (C1&C2)) & C2 llvm-svn: 7269
* IC: (X & C1) | C2 --> (X | C2) & (C1|C2)Chris Lattner2003-07-231-1/+26
| | | | | | | | | IC: (X ^ C1) | C2 --> (X | C2) ^ (C1&~C2) We are now guaranteed that all 'or's will be inside of 'and's, and all 'and's will be inside of 'xor's, if the second operands are constants. llvm-svn: 7264
* IC: (X ^ C1) & C2 --> (X & C2) ^ (C1&C2)Chris Lattner2003-07-231-4/+16
| | | | | | Minor code cleanup llvm-svn: 7262
* InstCombine: (X ^ 4) == 8 --> X == 12Chris Lattner2003-07-231-1/+6
| | | | llvm-svn: 7260
* IC: (X & 5) == 13 --> falseChris Lattner2003-07-231-5/+25
| | | | | | IC: (X | 8) == 4 --> false llvm-svn: 7257
* Simplify code by using ConstantInt::getRawValue instead of checking to seeChris Lattner2003-07-232-7/+2
| | | | | | whether the constant is signed or unsigned, then casting llvm-svn: 7252
* Fix bug: TailDup/2003-07-22-InfiniteLoop.llChris Lattner2003-07-231-0/+5
| | | | llvm-svn: 7243
* - InstCombine (cast (xor A, B) to bool) ==> (setne A, B)Chris Lattner2003-07-221-5/+44
| | | | | | - InstCombine (cast (and X, (1 << size(X)-1)) to bool) ==> x < 0 llvm-svn: 7241
* Added code that checks to see if a global variable is external before replacingJohn Criswell2003-07-211-1/+1
| | | | | | a load of the global variable with the variable's constant value. llvm-svn: 7216
* Dinakar and I fixed a bug where we were trying to get the initializer ofJohn Criswell2003-07-171-1/+1
| | | | | | | an external constant. Since external constants don't have initializers, we were failing on an assert() call in llvm/GlobalVariable.h. llvm-svn: 7193
* Add support for elimination of load instruction from global constantsChris Lattner2003-06-261-0/+48
| | | | llvm-svn: 6912
* Instcombine: X * -1 -> -XChris Lattner2003-06-251-3/+4
| | | | llvm-svn: 6904
* Fix bug: Mem2Reg/2003-06-26-IterativePromote.llChris Lattner2003-06-251-10/+17
| | | | llvm-svn: 6901
* Fix bug: ADCE/2003-06-24-BadSuccessor.llChris Lattner2003-06-241-12/+35
| | | | llvm-svn: 6891
* Do not mark ALL terminators live if any instruciton in the block is live. ↵Chris Lattner2003-06-241-2/+23
| | | | | | | | | We only want to mark it live if it is an unconditional branch. This fixes bug: ADCE/2002-05-28-Crash.ll and makes this pass _much_ more useful. llvm-svn: 6887
* Fix bug: SCCP/2003-06-24-OverdefinedPHIValue.llChris Lattner2003-06-241-4/+5
| | | | llvm-svn: 6883
* Fix bug: TailDup/2003-06-24-Simpleloop.llChris Lattner2003-06-241-1/+2
| | | | llvm-svn: 6881
* Implement new transforms:Chris Lattner2003-06-231-4/+33
| | | | | | | Replace (cast (sub A, B) to bool) -> (setne A, B) Replace (cast (add A, B) to bool) -> (setne A, -B) llvm-svn: 6873
* Add paranoia checkingChris Lattner2003-06-221-1/+1
| | | | llvm-svn: 6856
* Test changeChris Lattner2003-06-221-0/+1
| | | | llvm-svn: 6852
* Initial checkin of Tail duplication pass.Chris Lattner2003-06-221-0/+324
| | | | llvm-svn: 6846
* Instcombine cast (getelementptr Ptr, 0, 0, 0) to ... into: cast Ptr to ...Chris Lattner2003-06-211-0/+17
| | | | | | | This fixes type safety problems in a variety of benchmarks that were confusing DSA. llvm-svn: 6837
* Implement the functionality of InstCombine/call.llChris Lattner2003-06-191-1/+145
| | | | llvm-svn: 6783
* Don't corrupt memory when removing an instruction from the program, butChris Lattner2003-06-171-0/+1
| | | | | | not the worklist llvm-svn: 6733
* Fix bug: ADCE/2003-06-11-InvalidCFG.llChris Lattner2003-06-161-5/+14
| | | | | | | This was because we were deleting large chunks of functions without an exit block, because the post-dominance information was not useful. This broke crafty and twolf. llvm-svn: 6698
* Fix bug: InstCombine/2003-06-05-BranchInvertInfLoop.llChris Lattner2003-06-051-1/+1
| | | | llvm-svn: 6630
* Clean up previous code.Chris Lattner2003-06-041-11/+20
| | | | | | Add new combination to turn seteq X, 0 -> not(cast X to bool) llvm-svn: 6604
* Implement combination of boolean not with branchChris Lattner2003-06-041-0/+14
| | | | llvm-svn: 6599
* Implement xform: (X != 0) -> (bool)XChris Lattner2003-06-011-0/+3
| | | | llvm-svn: 6506
* Okay totally give up on trying to optimize aggregates that cannot be completelyChris Lattner2003-05-301-40/+6
| | | | | | broken up into their elements. Too many programs break because of this. llvm-svn: 6440
* add a check that allows the SRoA pass to avoid breaking programs, even if theirChris Lattner2003-05-301-1/+33
| | | | | | behavior is technically undefined llvm-svn: 6438
* Fix bug: ScalarRepl/2003-05-30-MultiLevel.llChris Lattner2003-05-301-4/+4
| | | | llvm-svn: 6428
* Fix bug: ScalarRepl/2003-05-29-ArrayFail.llChris Lattner2003-05-301-42/+128
| | | | llvm-svn: 6425
* Add commentChris Lattner2003-05-291-0/+11
| | | | llvm-svn: 6415
* Fix bug: Instcombine/2003-05-27-ConstExprCrash.llChris Lattner2003-05-271-27/+37
| | | | llvm-svn: 6352
* * Actually USE the statistic that we madeChris Lattner2003-05-271-6/+21
| | | | | | * Implement SRoA for arrays llvm-svn: 6349
* Implementation of the simple "scalar replacement of aggregates" transformationChris Lattner2003-05-271-0/+164
| | | | llvm-svn: 6346
* Fix bug: InstCombine/2003-05-26-CastMiscompile.llChris Lattner2003-05-261-1/+1
| | | | llvm-svn: 6338
* Remove using declarationsChris Lattner2003-05-221-11/+9
| | | | llvm-svn: 6306
* Minor cleanups.Chris Lattner2003-05-221-8/+5
| | | | | | | | | | | This hunk: - } else if (Src->getNumOperands() == 2 && Src->use_size() == 1) { + } else if (Src->getNumOperands() == 2) { Allows GEP folding to be more aggressive, which reduces the number of instructions and can dramatically speed up BasicAA in some cases. llvm-svn: 6286
* Hopefully, the final fix for `[Pp]ropogate'.Misha Brukman2003-05-203-15/+15
| | | | llvm-svn: 6251
* s/convertable/convertible/gMisha Brukman2003-05-201-1/+1
| | | | llvm-svn: 6248
* Fix long standing bugChris Lattner2003-05-151-1/+1
| | | | llvm-svn: 6232
OpenPOWER on IntegriCloud