Chris Lattner
f453a39185
InstCombine: (X ^ C1) & C2 --> (X & C2) iff (C1&C2) == 0
...
llvm-svn: 7272
2003-07-23 19:36:21 +00:00
Chris Lattner
80d9c3a900
- InstCombine: (X | C1) & C2 --> X & C2 iff C1 & C1 == 0
...
- InstCombine: (X | C) & C --> C
- InstCombine: (X | C1) & C2 --> (X | (C1&C2)) & C2
llvm-svn: 7269
2003-07-23 19:25:52 +00:00
Chris Lattner
76c1da471c
IC: (X & C1) | C2 --> (X | C2) & (C1|C2)
...
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
2003-07-23 18:29:44 +00:00
Chris Lattner
4b43cd9700
IC: (X ^ C1) & C2 --> (X & C2) ^ (C1&C2)
...
Minor code cleanup
llvm-svn: 7262
2003-07-23 17:57:01 +00:00
Chris Lattner
ae691a3068
InstCombine: (X ^ 4) == 8 --> X == 12
...
llvm-svn: 7260
2003-07-23 17:26:36 +00:00
Chris Lattner
b07de65646
IC: (X & 5) == 13 --> false
...
IC: (X | 8) == 4 --> false
llvm-svn: 7257
2003-07-23 17:02:11 +00:00
Chris Lattner
6ad460b336
Simplify code by using ConstantInt::getRawValue instead of checking to see
...
whether the constant is signed or unsigned, then casting
llvm-svn: 7252
2003-07-23 15:22:26 +00:00
Chris Lattner
74a266d229
Fix bug: TailDup/2003-07-22-InfiniteLoop.ll
...
llvm-svn: 7243
2003-07-23 03:32:41 +00:00
Chris Lattner
7594fa7280
- InstCombine (cast (xor A, B) to bool) ==> (setne A, B)
...
- InstCombine (cast (and X, (1 << size(X)-1)) to bool) ==> x < 0
llvm-svn: 7241
2003-07-22 21:46:59 +00:00
John Criswell
98946bac5b
Added code that checks to see if a global variable is external before replacing
...
a load of the global variable with the variable's constant value.
llvm-svn: 7216
2003-07-21 19:42:57 +00:00
Anand Shukla
d02a20b947
Added check for inlinable function
...
llvm-svn: 7206
2003-07-18 20:55:26 +00:00
Anand Shukla
bb730173d6
A pass to combine multiple backedges that go to same target
...
llvm-svn: 7201
2003-07-18 16:08:32 +00:00
John Criswell
dbaf5f719c
Dinakar and I fixed a bug where we were trying to get the initializer of
...
an external constant. Since external constants don't have initializers, we
were failing on an assert() call in llvm/GlobalVariable.h.
llvm-svn: 7193
2003-07-17 19:06:55 +00:00
Vikram S. Adve
f5914c9bca
Trace loads and stores as they happen (stores were being
...
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
2003-07-11 21:57:43 +00:00
Anand Shukla
cb78ec5ada
Added functionality to instrmentation pass
...
llvm-svn: 7161
2003-07-10 21:55:57 +00:00
John Criswell
258dfc0319
Merged in autoconf branch. This provides configuration via the autoconf
...
system.
llvm-svn: 7014
2003-06-30 21:59:07 +00:00
Chris Lattner
a824a1ab66
Eliminate using declarations, adjust for new DSGraph API
...
llvm-svn: 6992
2003-06-30 03:14:44 +00:00
Chris Lattner
17ea08b804
Allow the inlining limit to be controlled from the command line!
...
llvm-svn: 6929
2003-06-28 15:57:04 +00:00
Chris Lattner
6b54665aa9
Add support to globaldce for deleting dead function prototypes
...
llvm-svn: 6918
2003-06-26 05:41:18 +00:00
Chris Lattner
3dc8d444ff
When internalizing global ctor/dtor list, also mark it constant. This is gross, but
...
until DSA is working all of the time and is totally reliable, we do this.
llvm-svn: 6917
2003-06-26 05:30:40 +00:00
Chris Lattner
0cc143577c
Add support for elimination of load instruction from global constants
...
llvm-svn: 6912
2003-06-26 05:06:25 +00:00
Chris Lattner
ebbc28f553
Instcombine: X * -1 -> -X
...
llvm-svn: 6904
2003-06-25 17:09:20 +00:00
Chris Lattner
0903331006
Fix bug: Mem2Reg/2003-06-26-IterativePromote.ll
...
llvm-svn: 6901
2003-06-25 14:58:56 +00:00
Chris Lattner
e3d0b99978
Add argument to DAE to allow operation on non-internal functions
...
llvm-svn: 6895
2003-06-25 04:12:49 +00:00
Chris Lattner
2cd94ee470
Fix bug: ADCE/2003-06-24-BadSuccessor.ll
...
llvm-svn: 6891
2003-06-24 23:02:45 +00:00
Chris Lattner
aac87d1e58
Do not mark ALL terminators live if any instruciton in the block is live. 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
2003-06-24 21:49:45 +00:00
Chris Lattner
867b7661cb
Fix bug: SCCP/2003-06-24-OverdefinedPHIValue.ll
...
llvm-svn: 6883
2003-06-24 20:29:52 +00:00
Chris Lattner
e1051d9fcf
Fix bug: TailDup/2003-06-24-Simpleloop.ll
...
llvm-svn: 6881
2003-06-24 19:48:06 +00:00
Chris Lattner
e1f9e715c6
Implement new transforms:
...
Replace (cast (sub A, B) to bool) -> (setne A, B)
Replace (cast (add A, B) to bool) -> (setne A, -B)
llvm-svn: 6873
2003-06-23 21:59:52 +00:00
Chris Lattner
1586e054a6
avoid dividing by zero when dealing with zero sized types (like [0 x double])
...
llvm-svn: 6862
2003-06-23 17:36:49 +00:00
Chris Lattner
a98d464fd6
Add paranoia checking
...
llvm-svn: 6856
2003-06-22 20:46:00 +00:00
Chris Lattner
99633d8cd2
Test change
...
llvm-svn: 6852
2003-06-22 20:25:27 +00:00
Chris Lattner
6d372c7450
Initial checkin of Tail duplication pass.
...
llvm-svn: 6846
2003-06-22 20:10:28 +00:00
Chris Lattner
9a0da3e531
Instcombine cast (getelementptr Ptr, 0, 0, 0) to ... into: cast Ptr to ...
...
This fixes type safety problems in a variety of benchmarks that were confusing
DSA.
llvm-svn: 6837
2003-06-21 23:12:02 +00:00
Chris Lattner
95bf937b5a
Fix the build. :(
...
llvm-svn: 6797
2003-06-20 14:36:52 +00:00
Chris Lattner
3a8e92a30b
Changes to privatize NodeType
...
llvm-svn: 6795
2003-06-19 21:15:26 +00:00
Chris Lattner
29e8adc038
Implement the functionality of InstCombine/call.ll
...
llvm-svn: 6783
2003-06-19 17:00:31 +00:00
Chris Lattner
cee19b1ace
Remove a bunch of complicated code. The functionality is implemented in instcombine instead
...
llvm-svn: 6782
2003-06-19 16:59:19 +00:00
Chris Lattner
d176218b2d
Handle arguments passed in through the va_arg area
...
llvm-svn: 6769
2003-06-18 16:25:51 +00:00
Chris Lattner
911e2c331c
Initial checkin of DAE pass
...
llvm-svn: 6759
2003-06-17 22:21:05 +00:00
Chris Lattner
2b01ee820e
Don't corrupt memory when removing an instruction from the program, but
...
not the worklist
llvm-svn: 6733
2003-06-17 03:57:18 +00:00
Chris Lattner
64ec8f36aa
Fix bug: ADCE/2003-06-11-InvalidCFG.ll
...
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
2003-06-16 12:10:45 +00:00
Chris Lattner
326e1fb77d
Fix bug: LevelRaise/2003-06-07-EmptyArrayTest.ll
...
llvm-svn: 6669
2003-06-07 21:45:42 +00:00
Chris Lattner
26c238c746
Fix compilation problem on GCC 2.9x
...
llvm-svn: 6667
2003-06-07 20:29:58 +00:00
Chris Lattner
1bbfcd901c
Fix bug: InstCombine/2003-06-05-BranchInvertInfLoop.ll
...
llvm-svn: 6630
2003-06-05 20:12:51 +00:00
Anand Shukla
80e3f54082
Fixed a bug so initialization code is always inserted in main
...
llvm-svn: 6622
2003-06-05 06:02:46 +00:00
Chris Lattner
b7423ab729
Use a constant expr GEP instead of an actual instruction
...
llvm-svn: 6620
2003-06-05 04:48:18 +00:00
Chris Lattner
3c98c8953a
Make this work with counter > 127
...
llvm-svn: 6613
2003-06-04 20:08:47 +00:00
Sumant Kowshik
a961b3c083
Made changes suggested by Chris
...
llvm-svn: 6606
2003-06-04 08:03:57 +00:00
Chris Lattner
95d21756aa
Clean up previous code.
...
Add new combination to turn seteq X, 0 -> not(cast X to bool)
llvm-svn: 6604
2003-06-04 05:10:11 +00:00