summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Minor cleanupsChris Lattner2003-07-241-3/+3
| | | | llvm-svn: 7289
* Fix bug: FunctionResolve/2003-07-23-CPR-Reference.llChris Lattner2003-07-231-6/+8
| | | | | | | This fixes a long time annoyance which caused prototypes for bzero, bcopy, bcmp, fputs, and fputs_unlocked to never get deleted. Grr. llvm-svn: 7285
* 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-233-10/+3
| | | | | | 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
* Added check for inlinable functionAnand Shukla2003-07-181-1/+55
| | | | llvm-svn: 7206
* A pass to combine multiple backedges that go to same targetAnand Shukla2003-07-181-0/+227
| | | | llvm-svn: 7201
* 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
* Trace loads and stores as they happen (stores were beingVikram S. Adve2003-07-111-10/+17
| | | | | | | | | | | remembered in valuesStoredInFunction, but never traced at function return, and that's too late to be finding the error anyway). Stores trace both the value and the address being stored to, but after some experience I think only values should be traced. The pointer hash table just fills up far too quickly if every store address were traced. llvm-svn: 7169
* Added functionality to instrmentation passAnand Shukla2003-07-101-99/+111
| | | | llvm-svn: 7161
* Merged in autoconf branch. This provides configuration via the autoconfJohn Criswell2003-06-302-2/+2
| | | | | | system. llvm-svn: 7014
* Eliminate using declarations, adjust for new DSGraph APIChris Lattner2003-06-301-21/+19
| | | | llvm-svn: 6992
* Allow the inlining limit to be controlled from the command line!Chris Lattner2003-06-281-1/+5
| | | | llvm-svn: 6929
* Add support to globaldce for deleting dead function prototypesChris Lattner2003-06-261-1/+7
| | | | llvm-svn: 6918
* When internalizing global ctor/dtor list, also mark it constant. This is ↵Chris Lattner2003-06-261-0/+8
| | | | | | | | gross, but until DSA is working all of the time and is totally reliable, we do this. llvm-svn: 6917
* 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
* Add argument to DAE to allow operation on non-internal functionsChris Lattner2003-06-251-9/+21
| | | | llvm-svn: 6895
* 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
* avoid dividing by zero when dealing with zero sized types (like [0 x double])Chris Lattner2003-06-232-0/+2
| | | | llvm-svn: 6862
* 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
* Fix the build. :(Chris Lattner2003-06-201-3/+3
| | | | llvm-svn: 6797
* Changes to privatize NodeTypeChris Lattner2003-06-191-6/+6
| | | | llvm-svn: 6795
* Implement the functionality of InstCombine/call.llChris Lattner2003-06-191-1/+145
| | | | llvm-svn: 6783
* Remove a bunch of complicated code. The functionality is implemented in ↵Chris Lattner2003-06-191-118/+6
| | | | | | instcombine instead llvm-svn: 6782
* Handle arguments passed in through the va_arg areaChris Lattner2003-06-181-1/+7
| | | | llvm-svn: 6769
* Initial checkin of DAE passChris Lattner2003-06-171-0/+304
| | | | llvm-svn: 6759
* 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: LevelRaise/2003-06-07-EmptyArrayTest.llChris Lattner2003-06-071-1/+2
| | | | llvm-svn: 6669
* Fix compilation problem on GCC 2.9xChris Lattner2003-06-071-1/+1
| | | | llvm-svn: 6667
OpenPOWER on IntegriCloud