Chris Lattner
1a469385bd
Actually, leave the check in. This prevents us from counting dead arguments
...
as IPCP opportunities.
llvm-svn: 17680
2004-11-11 07:47:54 +00:00
Chris Lattner
dba9c2b0ef
Fix bug: IPConstantProp/deadarg.ll
...
llvm-svn: 17679
2004-11-11 07:46:29 +00:00
Chris Lattner
d920b5b770
Make IP Constant prop more aggressive about handling self recursive calls.
...
This implements IPConstantProp/recursion.ll
llvm-svn: 17666
2004-11-10 19:43:59 +00:00
Chris Lattner
b214a04a16
Do not let dead constant expressions hanging off of functions prevent IPCP.
...
This allows to elimination of a bunch of global pool descriptor args from
programs being pool allocated (and is also generally useful!)
llvm-svn: 17657
2004-11-09 20:47:30 +00:00
Chris Lattner
9f035c9fdb
Change this back so that I get stable numbers to reflect the change from the
...
nightly testers
llvm-svn: 17646
2004-11-09 08:05:23 +00:00
Chris Lattner
b924e8be62
Fix bug: 2004-11-08-FreeUseCrash.ll
...
llvm-svn: 17642
2004-11-09 05:10:56 +00:00
Chris Lattner
a9e56ddaa3
VERY large functions that are only called from one place are not really
...
exciting to inline. Only inline medium or small sized functions with a
single call site.
llvm-svn: 17588
2004-11-07 21:46:47 +00:00
Chris Lattner
a060b55dea
This is V9 specific, move it there.
...
llvm-svn: 17545
2004-11-07 00:39:26 +00:00
Chris Lattner
b5ff07e46e
Remove dead vars
...
llvm-svn: 17482
2004-11-05 04:46:22 +00:00
Chris Lattner
064071600d
Fix some warnings on VC++
...
llvm-svn: 17481
2004-11-05 04:45:43 +00:00
Chris Lattner
33ed2c8984
* Rearrange code slightly
...
* Disable broken transforms for simplifying (setcc (cast X to larger), CI)
where CC is not != or ==
llvm-svn: 17422
2004-11-02 03:50:32 +00:00
Chris Lattner
b81520727e
Speed up the tail duplication pass on the testcase below from 68.2s to 1.23s:
...
#define CL0(a) case a: f(); goto c;
#define CL1(a) CL0(a##0) CL0(a##1) CL0(a##2) CL0(a##3) CL0(a##4) CL0(a##5) \
CL0(a##6) CL0(a##7) CL0(a##8) CL0(a##9)
#define CL2(a) CL1(a##0) CL1(a##1) CL1(a##2) CL1(a##3) CL1(a##4) CL1(a##5) \
CL1(a##6) CL1(a##7) CL1(a##8) CL1(a##9)
#define CL3(a) CL2(a##0) CL2(a##1) CL2(a##2) CL2(a##3) CL2(a##4) CL2(a##5) \
CL2(a##6) CL2(a##7) CL2(a##8) CL2(a##9)
#define CL4(a) CL3(a##0) CL3(a##1) CL3(a##2) CL3(a##3) CL3(a##4) CL3(a##5) \
CL3(a##6) CL3(a##7) CL3(a##8) CL3(a##9)
void f();
void a() {
int b;
c: switch (b) {
CL4(1)
}
}
This comes from GCC PR 15524
llvm-svn: 17390
2004-11-01 07:05:07 +00:00
Chris Lattner
3083f2a424
Do not compute the predecessor list for a block unless we need it.
...
This speeds up simplifycfg on this program, from 44.87s to 0.29s (with
a profiled build):
#define CL0(a) case a: goto c;
#define CL1(a) CL0(a##0) CL0(a##1) CL0(a##2) CL0(a##3) CL0(a##4) CL0(a##5) \
CL0(a##6) CL0(a##7) CL0(a##8) CL0(a##9)
#define CL2(a) CL1(a##0) CL1(a##1) CL1(a##2) CL1(a##3) CL1(a##4) CL1(a##5) \
CL1(a##6) CL1(a##7) CL1(a##8) CL1(a##9)
#define CL3(a) CL2(a##0) CL2(a##1) CL2(a##2) CL2(a##3) CL2(a##4) CL2(a##5) \
CL2(a##6) CL2(a##7) CL2(a##8) CL2(a##9)
#define CL4(a) CL3(a##0) CL3(a##1) CL3(a##2) CL3(a##3) CL3(a##4) CL3(a##5) \
CL3(a##6) CL3(a##7) CL3(a##8) CL3(a##9)
void f();
void a() {
int b;
c: switch (b) {
CL4(1)
}
}
This testcase is contrived to expose N^2 behavior, but this patch should speedup
simplifycfg on any programs that use large switch statements. This testcase
comes from GCC PR17895.
llvm-svn: 17389
2004-11-01 06:53:58 +00:00
Reid Spencer
d3f7233495
Change Library Names Not To Conflict With Others When Installed
...
llvm-svn: 17286
2004-10-27 23:18:45 +00:00
Chris Lattner
dd0094e4ed
Convert 'struct' to 'class' in various places to adhere to the coding standards
...
and work better with VC++. Patch contributed by Morten Ofstad!
llvm-svn: 17281
2004-10-27 16:14:51 +00:00
Chris Lattner
000424b69e
Hrm, this code was severely botched. As it turns out, this patch:
...
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041018/019708.html
exposed ANOTHER latent bug in this xform, which caused Prolangs-C/bison to fill
the zion nightly tester disk up and make the tester barf.
This is obviously not a good thing, so lets fix this bug shall we? :)
llvm-svn: 17276
2004-10-27 05:57:15 +00:00
Chris Lattner
abfae1c72e
Initialize with the correct constant type
...
llvm-svn: 17270
2004-10-27 03:55:24 +00:00
Chris Lattner
895f16ebfc
Fix compatibility with MSVC, patch by Morten Ofstad
...
llvm-svn: 17218
2004-10-25 18:45:16 +00:00
Reid Spencer
9f6f128630
Eliminate compilation warning on uninitialized variable.
...
llvm-svn: 17163
2004-10-22 16:10:39 +00:00
Chris Lattner
f0e2ce2279
*** empty log message ***
...
llvm-svn: 17161
2004-10-22 06:43:28 +00:00
Chris Lattner
6321852143
Fix a bug Nate noticed, where we miscompiled a simple testcase
...
llvm-svn: 17157
2004-10-22 04:53:16 +00:00
Reid Spencer
e48ba34fd4
We won't use automake
...
llvm-svn: 17155
2004-10-22 03:35:04 +00:00
Brian Gaeke
71ff3efdd5
Explain what this pass does.
...
llvm-svn: 17146
2004-10-20 19:38:58 +00:00
Chris Lattner
e555b5c5cb
Hrm, some people complain when the compiler cheerfully tells them what it's
...
doing... I guess they're right.
llvm-svn: 17142
2004-10-19 06:33:16 +00:00
Reid Spencer
ce514b1c2c
Initial automake generated Makefile template
...
llvm-svn: 17136
2004-10-18 23:55:41 +00:00
Nate Begeman
49e38c2185
Initial implementation of the strength reduction for GEP instructions in
...
loops. This optimization is not turned on by default yet, but may be run
with the opt tool's -loop-reduce flag. There are many FIXMEs listed in the
code that will make it far more applicable to a wide range of code, but you
have to start somewhere :)
This limited version currently triggers on the following tests in the
MultiSource directory:
pcompress2: 7 times
cfrac: 5 times
anagram: 2 times
ks: 6 times
yacr2: 2 times
llvm-svn: 17134
2004-10-18 21:08:22 +00:00
Chris Lattner
9e2649a7be
Get this file compiling with VC++, patch contributed by Morten Ofstad. Thanks Morten!
...
llvm-svn: 17125
2004-10-18 15:43:46 +00:00
Reid Spencer
2b5cfe8be8
Correction to allow compilation with Visual C++.
...
Patch contributed by Morten Ofstad. Thanks Morten!
llvm-svn: 17123
2004-10-18 14:38:48 +00:00
Chris Lattner
b1827a765a
Simplify code by deleting instructions that preceed unreachable instructions.
...
Simplify code by simplifying terminators that branch to blocks that start
with an unreachable instruction.
llvm-svn: 17116
2004-10-18 04:07:22 +00:00
Chris Lattner
3c1be63b41
Turn store -> null/undef into the LLVM unreachable instruction! This simple
...
change hacks off 10K of bytecode from perlbmk (.5%) even though the front-end
is not generating them yet and we are not optimizing the resultant code.
This isn't too bad.
llvm-svn: 17111
2004-10-18 03:00:50 +00:00
Chris Lattner
18333c64de
Turn things with obviously undefined semantics into 'store -> null'
...
llvm-svn: 17110
2004-10-18 02:59:09 +00:00
Chris Lattner
dbfa9a5e9c
My friend the invoke instruction does not dominate all basic blocks if it
...
occurs in the entry node of a function
llvm-svn: 17109
2004-10-18 01:48:31 +00:00
Chris Lattner
f7bf129037
Fix a bug that occurs when the constant value is the result of an invoke. In
...
particular, invoke ret values are only live in the normal dest of the invoke
not in the unwind dest.
llvm-svn: 17108
2004-10-18 01:21:17 +00:00
Chris Lattner
44a7cf480d
Getting ADCE to interact well with unreachable instructions seems like a nontrivial
...
exercise that I'm not interested in tackling right now. Just punt and treat them
like unwind's.
This 'fixes' test/Regression/Transforms/ADCE/unreachable-function.ll
llvm-svn: 17106
2004-10-17 23:45:06 +00:00
Chris Lattner
9e7ddf8596
Fix Regression/Transforms/Inline/2004-10-17-InlineFunctionWithoutReturn.ll
...
If a function had no return instruction in it, and the result of the inlined
call instruction was used, we would crash.
llvm-svn: 17104
2004-10-17 23:21:07 +00:00
Chris Lattner
795ae57cde
Remove printout, realize that instructions in the entry block dominate all
...
other blocks.
llvm-svn: 17099
2004-10-17 21:31:34 +00:00
Chris Lattner
ac92e5fcd0
When inserting PHI nodes, don't insert any phi nodes that are obviously
...
unneccesary. This allows us to delete several hundred phi nodes of the
form PHI(x,x,x,undef) from 253.perlbmk and probably other programs as well.
This implements Mem2Reg/UndefValuesMerge.ll
llvm-svn: 17098
2004-10-17 21:25:56 +00:00
Chris Lattner
306dd8a44a
Enhance hasConstantValue to ignore undef values in phi nodes. This allows it
...
to think that PHI[4, undef] == 4.
llvm-svn: 17096
2004-10-17 21:23:26 +00:00
Chris Lattner
ef0888e493
hasConstantValue will soon return instructions that don't dominate the PHI node,
...
so prepare for this.
llvm-svn: 17095
2004-10-17 21:22:38 +00:00
Chris Lattner
68f14bc09c
Fix a type violation
...
llvm-svn: 17069
2004-10-16 23:28:04 +00:00
Chris Lattner
d12442c206
Kill the bogon that slipped into my buffer before I committed.
...
llvm-svn: 17067
2004-10-16 19:46:33 +00:00
Chris Lattner
b55574181d
Implement InstCombine/getelementptr.ll:test9, which is the source of many
...
ugly and giant constnat exprs in some programs.
llvm-svn: 17066
2004-10-16 19:44:59 +00:00
Chris Lattner
2fae8a1ef9
Add support for unreachable
...
llvm-svn: 17056
2004-10-16 18:21:33 +00:00
Chris Lattner
3ebca6fb19
Optimize instructions involving undef values. For example X+undef == undef.
...
llvm-svn: 17047
2004-10-16 18:11:37 +00:00
Chris Lattner
4fca8caaee
Add support for UndefValue
...
llvm-svn: 17046
2004-10-16 18:10:31 +00:00
Chris Lattner
ca01f160ee
When promoting mem2reg, make uninitialized values become undef isntead of 0.
...
llvm-svn: 17045
2004-10-16 18:10:06 +00:00
Chris Lattner
80f963c30b
Handle undef values as undefined on the constant lattice
...
ignore unreachable instructions
llvm-svn: 17044
2004-10-16 18:09:41 +00:00
Chris Lattner
c630ba08cf
Add note
...
llvm-svn: 17043
2004-10-16 18:09:25 +00:00
Chris Lattner
4a37579191
Add support for the undef value. Implement a new optimization based on globals
...
that are initialized with undef. When promoting malloc to a global, start out
initialized to undef
llvm-svn: 17042
2004-10-16 18:09:00 +00:00
Chris Lattner
7319d9289f
Fix a bug John tracked down in libstdc++ where we were incorrectly deleting
...
weak functions. Thanks for finding this John!
llvm-svn: 16997
2004-10-14 19:53:50 +00:00