- Oct 16, 2004
-
-
Chris Lattner authored
llvm-svn: 17043
-
Chris Lattner authored
that are initialized with undef. When promoting malloc to a global, start out initialized to undef llvm-svn: 17042
-
- Oct 14, 2004
-
-
Chris Lattner authored
weak functions. Thanks for finding this John! llvm-svn: 16997
-
Chris Lattner authored
nodes unless we KNOW that we are able to promote all of them. This fixes: test/Regression/Transforms/SimplifyCFG/PhiNoEliminate.ll llvm-svn: 16973
-
- Oct 13, 2004
-
-
Reid Spencer authored
llvm-svn: 16950
-
- Oct 12, 2004
-
-
Chris Lattner authored
llvm-svn: 16932
-
Chris Lattner authored
marker from one ilist into the middle of another basic block! llvm-svn: 16925
-
Chris Lattner authored
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
-
- Oct 11, 2004
-
-
Chris Lattner authored
llvm-svn: 16918
-
Chris Lattner authored
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
-
Chris Lattner authored
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
-
Reid Spencer authored
llvm-svn: 16893
-
- Oct 10, 2004
-
-
Chris Lattner authored
llvm-svn: 16878
-
Chris Lattner authored
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
-
Chris Lattner authored
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
-
- Oct 09, 2004
-
-
Chris Lattner authored
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
-
Chris Lattner authored
-debug-only! llvm-svn: 16868
-
Chris Lattner authored
llvm-svn: 16864
-
Chris Lattner authored
llvm-svn: 16863
-
Chris Lattner authored
llvm-svn: 16858
-
- Oct 08, 2004
-
-
Chris Lattner authored
* 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
-
Chris Lattner authored
we know it is dead. llvm-svn: 16855
-
Chris Lattner authored
254.gap. llvm-svn: 16853
-
Chris Lattner authored
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
-
Chris Lattner authored
This comes up when doing adds to bitfield elements. llvm-svn: 16836
-
Chris Lattner authored
This triggers in cases of bitfield additions, opening opportunities for future improvements. llvm-svn: 16834
-
- Oct 07, 2004
-
-
Chris Lattner authored
llvm-svn: 16814
-
Chris Lattner authored
llvm-svn: 16804
-
Chris Lattner authored
llvm-svn: 16803
-
Chris Lattner authored
* Instead of handling dead functions specially, just nuke them. * Be more aggressive about cleaning up after constification, in particular, handle getelementptr instructions and constantexprs. * Be a little bit more structured about how we process globals. *** Delete globals that are only stored to, and never read. These are clearly not useful, so they should go. This implements deadglobal.llx This last one triggers quite a few times. In particular, 2208 in the external tests, 1865 of which are in 252.eon. This shrinks eon from 1995094 to 1732341 bytes of bytecode. llvm-svn: 16802
-
- Oct 06, 2004
-
-
Chris Lattner authored
simplifications of the resultant program to avoid making later passes do it all. This allows us to constify globals that just have the same constant that they are initialized stored into them. Suprisingly this comes up ALL of the freaking time, dozens of times in SPEC, 30 times in vortex alone. For example, on 256.bzip2, it allows us to constify these two globals: %smallMode = internal global ubyte 0 ; <ubyte*> [#uses=8] %verbosity = internal global int 0 ; <int*> [#uses=49] Which (with later optimizations) results in the bytecode file shrinking from 82286 to 69686 bytes! Lets hear it for IPO :) For the record, it's nuking lots of "if (verbosity > 2) { do lots of stuff }" code. llvm-svn: 16793
-
Chris Lattner authored
llvm-svn: 16769
-
Chris Lattner authored
an instruction if it can be hoisted to a common dominator of the block. This implements: test/Regression/Transforms/TailDup/MergeTest.ll llvm-svn: 16758
-
- Sep 30, 2004
-
-
Brian Gaeke authored
llvm-svn: 16622
-
Brian Gaeke authored
llvm-svn: 16621
-
Brian Gaeke authored
llvm-svn: 16620
-
Chris Lattner authored
that always prints when linking programs to libstdc++ :( llvm-svn: 16603
-
- Sep 29, 2004
-
-
Chris Lattner authored
llvm-svn: 16598
-
Chris Lattner authored
* SubOne/AddOne functions always return ConstantInt, declare them as such * Pull code for handling setcc X, cst, where cst is at the end of the range, or cc is LE or GE up earlier in visitSetCondInst. This reduces #iterations in some cases. * Fold: (div X, C1) op C2 -> range check, implementing div.ll:test6 - test9. llvm-svn: 16588
-
Chris Lattner authored
potentially fold more in one pass. llvm-svn: 16583
-