| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
Thanks Morten!
llvm-svn: 17125
|
| |
|
|
|
|
| |
Patch contributed by Morten Ofstad. Thanks Morten!
llvm-svn: 17123
|
| |
|
|
|
|
|
| |
Simplify code by simplifying terminators that branch to blocks that start
with an unreachable instruction.
llvm-svn: 17116
|
| |
|
|
|
|
|
|
| |
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
|
| |
|
|
| |
llvm-svn: 17110
|
| |
|
|
|
|
| |
occurs in the entry node of a function
llvm-svn: 17109
|
| |
|
|
|
|
|
| |
particular, invoke ret values are only live in the normal dest of the invoke
not in the unwind dest.
llvm-svn: 17108
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
other blocks.
llvm-svn: 17099
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
to think that PHI[4, undef] == 4.
llvm-svn: 17096
|
| |
|
|
|
|
| |
so prepare for this.
llvm-svn: 17095
|
| |
|
|
| |
llvm-svn: 17069
|
| |
|
|
| |
llvm-svn: 17067
|
| |
|
|
|
|
| |
ugly and giant constnat exprs in some programs.
llvm-svn: 17066
|
| |
|
|
| |
llvm-svn: 17056
|
| |
|
|
| |
llvm-svn: 17047
|
| |
|
|
| |
llvm-svn: 17046
|
| |
|
|
| |
llvm-svn: 17045
|
| |
|
|
|
|
| |
ignore unreachable instructions
llvm-svn: 17044
|
| |
|
|
| |
llvm-svn: 17043
|
| |
|
|
|
|
|
| |
that are initialized with undef. When promoting malloc to a global, start out
initialized to undef
llvm-svn: 17042
|
| |
|
|
|
|
| |
weak functions. Thanks for finding this John!
llvm-svn: 16997
|
| |
|
|
|
|
|
|
| |
nodes unless we KNOW that we are able to promote all of them.
This fixes: test/Regression/Transforms/SimplifyCFG/PhiNoEliminate.ll
llvm-svn: 16973
|
| |
|
|
| |
llvm-svn: 16950
|
| |
|
|
| |
llvm-svn: 16932
|
| |
|
|
|
|
| |
marker from one ilist into the middle of another basic block!
llvm-svn: 16925
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
pointer recurrences into expressions from this:
%P_addr.0.i.0 = phi sbyte* [ getelementptr ([8 x sbyte]* %.str_1, int 0, int 0), %entry ], [ %inc.0.i, %no_exit.i ]
%inc.0.i = getelementptr sbyte* %P_addr.0.i.0, int 1 ; <sbyte*> [#uses=2]
into this:
%inc.0.i = getelementptr sbyte* getelementptr ([8 x sbyte]* %.str_1, int 0, int 0), int %inc.0.i.rec
Actually create something nice, like this:
%inc.0.i = getelementptr [8 x sbyte]* %.str_1, int 0, int %inc.0.i.rec
llvm-svn: 16924
|
| |
|
|
| |
llvm-svn: 16918
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
First, it allows SRA of globals that have embedded arrays, implementing
GlobalOpt/globalsra-partial.llx. This comes up infrequently, but does allow,
for example, deleting several stores to dead parts of globals in dhrystone.
Second, this implements GlobalOpt/malloc-promote-*.llx, which is the
following nifty transformation:
Basically if a global pointer is initialized with malloc, and we can tell
that the program won't notice, we transform this:
struct foo *FooPtr;
...
FooPtr = malloc(sizeof(struct foo));
...
FooPtr->A FooPtr->B
Into:
struct foo FooPtrBody;
...
FooPtrBody.A FooPtrBody.B
This comes up occasionally, for example, the 'disp' global in 183.equake (where
the xform speeds the CBE version of the program up from 56.16s to 52.40s (7%)
on apoc), and the 'desired_accept', 'fixLRBT', 'macroArray', & 'key_queue'
globals in 300.twolf (speeding it up from 22.29s to 21.55s (3.4%)).
The nice thing about this xform is that it exposes the resulting global to
global variable optimization and makes alias analysis easier in addition to
eliminating a few loads.
llvm-svn: 16916
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
still optimize away all of the indirect calls and loads, etc from it.
This turns code like this:
if (G != 0)
G();
into
if (G != 0)
ActualCallee();
This triggers a couple of times in gcc and libstdc++.
llvm-svn: 16901
|
| |
|
|
| |
llvm-svn: 16893
|
| |
|
|
| |
llvm-svn: 16878
|
| |
|
|
|
|
|
| |
stored to, but are stored at variable indexes. This occurs at least in
176.gcc, but probably others, and we should handle it for completeness.
llvm-svn: 16876
|
| |
|
|
|
|
|
|
|
| |
has a large number of users. Instead, just keep track of whether we're
making changes as we do so.
This patch has no functionlity changes.
llvm-svn: 16874
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
we know that all uses of the global will trap if the pointer contained is
null. In this case, we forward substitute the stored value to any uses.
This has the effect of devirtualizing trivial globals in trivial cases. For
example, 164.gzip contains this:
gzip.h:extern int (*read_buf) OF((char *buf, unsigned size));
bits.c: read_buf = file_read;
deflate.c: lookahead = read_buf((char*)window,
deflate.c: n = read_buf((char*)window+strstart+lookahead, more);
Since read_buf has to point to file_read at every use, we just replace
the calls through read_buf with a direct call to file_read.
This occurs in several benchmarks, including 176.gcc and 164.gzip. Direct
calls are good and stuff.
llvm-svn: 16871
|
| |
|
|
|
|
| |
-debug-only!
llvm-svn: 16868
|
| |
|
|
| |
llvm-svn: 16864
|
| |
|
|
| |
llvm-svn: 16863
|
| |
|
|
| |
llvm-svn: 16858
|
| |
|
|
|
|
|
|
|
|
| |
* Do not lead dangling dead constants prevent optimization
* Iterate global optimization while we're making progress.
These changes allow us to be more aggressive, handling cases like
GlobalOpt/iterate.llx without a problem (turning it into 'ret int 0').
llvm-svn: 16857
|
| |
|
|
|
|
| |
we know it is dead.
llvm-svn: 16855
|
| |
|
|
|
|
| |
254.gap.
llvm-svn: 16853
|
| |
|
|
|
|
|
|
|
|
|
| |
optimizations to trigger much more often. This allows the elimination of
several dozen more global variables in Programs/External. Note that we only
do this for non-constant globals: constant globals will already be optimized
out if the accesses to them permit it.
This implements Transforms/GlobalOpt/globalsra.llx
llvm-svn: 16842
|
| |
|
|
|
|
| |
This comes up when doing adds to bitfield elements.
llvm-svn: 16836
|
| |
|
|
|
|
|
| |
This triggers in cases of bitfield additions, opening opportunities for
future improvements.
llvm-svn: 16834
|
| |
|
|
| |
llvm-svn: 16814
|
| |
|
|
| |
llvm-svn: 16804
|