Chris Lattner
8cfd7fbf35
stop using method.
...
llvm-svn: 20603
2005-03-15 05:19:49 +00:00
Chris Lattner
4b688a1c70
This mega patch converts us from using Function::a{iterator|begin|end} to
...
using Function::arg_{iterator|begin|end}. Likewise Module::g* -> Module::global_*.
This patch is contributed by Gabor Greif, thanks!
llvm-svn: 20597
2005-03-15 04:54:21 +00:00
Chris Lattner
6d6f980ca7
fix a bug where we thought arguments were constants :(
...
llvm-svn: 20506
2005-03-06 22:52:29 +00:00
Chris Lattner
2174b70c68
Fix Regression/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll,
...
hopefully not breaking too many other things.
llvm-svn: 20505
2005-03-06 22:36:12 +00:00
Chris Lattner
a29e319d54
implement Transforms/LoopStrengthReduce/invariant_value_first_arg.ll
...
llvm-svn: 20501
2005-03-06 22:06:22 +00:00
Chris Lattner
18fdd1e9f6
minor simplifications of the code.
...
llvm-svn: 20497
2005-03-06 21:58:22 +00:00
Chris Lattner
53c34a2147
trivial simplification
...
llvm-svn: 20494
2005-03-06 21:35:38 +00:00
Chris Lattner
b4e635cfc4
Fix a bug where we could corrupt a parent loop's header info if we unrolled
...
a nested loop. This fixes Transforms/LoopUnroll/2005-03-06-BadLoopInfoUpdate.ll
and PR532
llvm-svn: 20493
2005-03-06 20:57:32 +00:00
Chris Lattner
0ed850a944
Make this MUCH faster by avoiding a linear search in the symbol table code.
...
llvm-svn: 20479
2005-03-06 05:42:36 +00:00
Jeff Cohen
db51926d4a
Reformat comments to fix 80 columns.
...
llvm-svn: 20467
2005-03-05 22:45:40 +00:00
Jeff Cohen
023f10be12
Reuse induction variables created for strength-reduced GEPs by other similar GEPs.
...
llvm-svn: 20466
2005-03-05 22:40:34 +00:00
Chris Lattner
1ccff5c8c7
second argument to Value::setName is now gone.
...
llvm-svn: 20463
2005-03-05 19:05:20 +00:00
Chris Lattner
cadc85daa5
Do not compute 1ULL << 64, which is undefined. This fixes Ptrdist/ks on the
...
sparc, and testcase Regression/Transforms/InstCombine/2005-03-04-ShiftOverflow.ll
llvm-svn: 20445
2005-03-04 23:21:33 +00:00
Jeff Cohen
29ecafb2e3
Add support for not strength reducing GEPs where the element size is a small
...
power of two. This emphatically includes the zeroeth power of two.
llvm-svn: 20429
2005-03-04 04:04:26 +00:00
Chris Lattner
4814696e7d
Add an optional argument to lower to a specific constant value instead of
...
to a "sizeof" expression.
llvm-svn: 20414
2005-03-03 01:03:43 +00:00
Jeff Cohen
6d82d5b23e
Fixed the following LSR bugs:
...
* 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.
llvm-svn: 20383
2005-03-01 03:46:11 +00:00
Jeff Cohen
d5b1827c3f
Fix crash in LSR due to attempt to remove original induction variable. However,
...
for reasons explained in the comments, I also deactivated this code as it needs
more thought.
llvm-svn: 20367
2005-02-28 00:08:56 +00:00
Jeff Cohen
fd9504c7d9
PHI nodes were incorrectly placed when more than one GEP is reduced in a loop.
...
llvm-svn: 20360
2005-02-27 21:08:04 +00:00
Jeff Cohen
6258d4a431
First pass at improved Loop Strength Reduction. Still not yet ready for prime time.
...
llvm-svn: 20358
2005-02-27 19:37:07 +00:00
Chris Lattner
73d4556bb6
Teach globalopt how memset/cpy/move affect memory, to allow better optimization.
...
llvm-svn: 20352
2005-02-27 18:58:52 +00:00
Chris Lattner
a024984017
Fix spelling, patch contributed by Gabor Greif!
...
llvm-svn: 20343
2005-02-27 06:18:25 +00:00
Chris Lattner
14f720d625
remove extraneous cast
...
llvm-svn: 20334
2005-02-26 18:33:28 +00:00
Chris Lattner
7a434679c3
Implement Transforms/SimplifyCFG/switch_thread.ll
...
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! :)
llvm-svn: 20300
2005-02-24 06:17:52 +00:00
Chris Lattner
bfb6a94126
make this more efficient. Scan up to 16 nodes, not the whole list.
...
llvm-svn: 20289
2005-02-23 16:53:04 +00:00
Chris Lattner
b5256c157d
Remove use of bind_obj
...
llvm-svn: 20276
2005-02-22 23:22:58 +00:00
Chris Lattner
29126b65c4
Do not mark obviously unreachable blocks live when processing PHI nodes,
...
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
llvm-svn: 20227
2005-02-17 19:28:49 +00:00
Chris Lattner
0a61115d67
Fix the second bug attached to PR504.
...
llvm-svn: 20181
2005-02-14 20:11:45 +00:00
Chris Lattner
8f3f72f2bc
Fix for testcase Transforms/IndVarsSimplify/2005-02-11-InvokeCrash.ll
...
and PR504.
llvm-svn: 20129
2005-02-12 03:26:49 +00:00
Alkis Evlogimenos
82f384712f
Localize globals if they are only used in main(). This replaces the
...
global with an alloca, which eventually gets promoted into a
register. This enables a lot of other optimizations later on.
llvm-svn: 20109
2005-02-10 18:36:30 +00:00
Alkis Evlogimenos
3521fcb18f
Fix crash on MallocInsts of unsized types.
...
llvm-svn: 19988
2005-02-02 04:43:37 +00:00
Chris Lattner
d04865822c
API change.
...
llvm-svn: 19959
2005-02-01 01:23:49 +00:00
Chris Lattner
555ef32a44
Adjust to changes in APIs
...
llvm-svn: 19958
2005-02-01 01:23:31 +00:00
Chris Lattner
849a4118e6
Hacks to make this ugly ugly code work with the new use lists.
...
llvm-svn: 19957
2005-02-01 01:22:56 +00:00
Chris Lattner
c4884b553e
Implement InstCombine/cast.ll:test25, a case that occurs many times
...
in spec
llvm-svn: 19953
2005-01-31 05:51:45 +00:00
Chris Lattner
6a431c25d1
Implement the trivial cases in InstCombine/store.ll
...
llvm-svn: 19950
2005-01-31 05:36:43 +00:00
Chris Lattner
a4ba8e9f0d
Implement Transforms/InstCombine/cast-load-gep.ll, which allows us to devirtualize
...
11 indirect calls in perlbmk.
llvm-svn: 19947
2005-01-31 04:50:46 +00:00
Chris Lattner
c29f25e260
Adjust to changes in instruction interfaces.
...
llvm-svn: 19900
2005-01-29 00:39:08 +00:00
Chris Lattner
7dab604f10
Switchinst takes a hint for the number of cases it will have.
...
llvm-svn: 19899
2005-01-29 00:38:45 +00:00
Chris Lattner
ccc0c99fae
switchinst ctor now takes a hint for the number of cases that it will have.
...
llvm-svn: 19898
2005-01-29 00:38:26 +00:00
Chris Lattner
d87666619f
Adjust Valuehandle to hold its operand directly in it.
...
llvm-svn: 19897
2005-01-29 00:37:36 +00:00
Chris Lattner
b035ec4a9c
* add some DEBUG statements
...
* Properly compile this:
struct a {};
int test() {
struct a b[2];
if (&b[0] != &b[1])
abort ();
return 0;
}
to 'return 0', not abort().
llvm-svn: 19875
2005-01-28 19:32:01 +00:00
Alkis Evlogimenos
eb6bfe9cee
Add a dependency to the trace library so that it gets pulled in
...
automatically.
llvm-svn: 19828
2005-01-25 16:23:57 +00:00
Chris Lattner
ab2ab313d3
Get rid of a several dozen more and instructions in specint.
...
llvm-svn: 19786
2005-01-23 20:26:55 +00:00
Chris Lattner
151c8e6390
Handle comparisons of gep instructions that have different typed indices
...
as long as they are the same size.
llvm-svn: 19734
2005-01-21 23:06:49 +00:00
Chris Lattner
5a9660aa71
Add two optimizations. The first folds (X+Y)-X -> Y
...
The second folds operations into selects, e.g. (select C, (X+Y), (Y+Z))
-> (Y+(select C, X, Z)
This occurs a few times across spec, e.g.
select add/sub
mesa: 83 0
povray: 5 2
gcc 4 2
parser 0 22
perlbmk 13 30
twolf 0 3
llvm-svn: 19706
2005-01-19 21:50:18 +00:00
Chris Lattner
302ea8908d
Fix 'raise' to work with packed types. Patch by Morten Ofstad.
...
llvm-svn: 19693
2005-01-19 16:16:35 +00:00
Chris Lattner
3402945d52
Delete PHI nodes that are not dead but are locked in a cycle of single
...
useness.
llvm-svn: 19629
2005-01-17 05:10:15 +00:00
Chris Lattner
de6b1ca556
Move code out of indentation one level to make it easier to read.
...
Disable the xform for < > cases. It turns out that the following is being
miscompiled:
bool %test(sbyte %S) {
%T = cast sbyte %S to uint
%V = setgt uint %T, 255
ret bool %V
}
llvm-svn: 19628
2005-01-17 03:20:02 +00:00
Chris Lattner
708ff662ba
Fix some bugs in an xform added yesterday. This fixes Prolangs-C/allroots.
...
llvm-svn: 19553
2005-01-14 17:35:12 +00:00
Chris Lattner
13fd87be57
Fix a compile crash on spiff
...
llvm-svn: 19552
2005-01-14 17:17:59 +00:00