summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Complete the NumberTable --> LeaderTable rename.Owen Anderson2011-01-041-12/+12
| | | | llvm-svn: 122828
* Fix typo in a comment.Owen Anderson2011-01-041-1/+1
| | | | llvm-svn: 122827
* Prune #include's.Owen Anderson2011-01-041-10/+0
| | | | llvm-svn: 122826
* Clarify terminology, settling on referring to what was the "number table" as ↵Owen Anderson2011-01-041-32/+32
| | | | | | | | the "leader table", and rename methods to make it much more clear what they're doing. llvm-svn: 122823
* When removing a value from GVN's leaders list, don't drop the Next pointer ↵Owen Anderson2011-01-041-1/+2
| | | | | | in a corner case. llvm-svn: 122822
* Improve the accuracy of the inlining heuristic looking for theDale Johannesen2011-01-041-9/+14
| | | | | | | | | | case where a static caller is itself inlined everywhere else, and thus may go away if it doesn't get too big due to inlining other things into it. If there are references to the caller other than calls, it will not be removed; account for this. This results in same-day completion of the case in PR8853. llvm-svn: 122821
* Branch instructions don't produce values, so there's no need to generate a ↵Owen Anderson2011-01-041-5/+3
| | | | | | | | | value number for them. This avoids adding them to the various value numbering tables, resulting in a minor (~3%) speedup for GVN on 40.gcc. llvm-svn: 122819
* Remove commented out code.Owen Anderson2011-01-041-4/+0
| | | | llvm-svn: 122817
* Switch to the new style of asterisk placement.Cameron Zwarich2011-01-041-8/+8
| | | | llvm-svn: 122815
* Teach loop-idiom to turn a loop containing a memset into a larger memsetChris Lattner2011-01-041-18/+69
| | | | | | | | | | | | | | | | when safe. The testcase is basically this nested loop: void foo(char *X) { for (int i = 0; i != 100; ++i) for (int j = 0; j != 100; ++j) X[j+i*100] = 0; } which gets turned into a single memset now. clang -O3 doesn't optimize this yet though due to a phase ordering issue I haven't analyzed yet. llvm-svn: 122806
* restructure this a bit. Initialize the WeakVH with "I", theChris Lattner2011-01-041-11/+14
| | | | | | | | instruction *after* the store. The store will always be deleted if the transformation kicks in, so we'd do an N^2 scan of every loop block. Whoops. llvm-svn: 122805
* Avoid finding loop back edges when we are not splitting critical edges inCameron Zwarich2011-01-041-2/+4
| | | | | | CodeGenPrepare (which is the default behavior). llvm-svn: 122801
* Address most of Duncan's review comments. Also, make LoopInstSimplify a simpleCameron Zwarich2011-01-041-37/+15
| | | | | | | | | | | | FunctionPass. It probably doesn't have a reason to be a LoopPass, as it will probably drop the simple fixed point and either use RPO iteration or Duncan's approach in instsimplify of only revisiting instructions that have changed. The next step is to preserve LoopSimplify. This looks like it won't be too hard, although the pass manager doesn't actually seem to respect when non-loop passes claim to preserve LCSSA or LoopSimplify. This will have to be fixed. llvm-svn: 122791
* use the very-handy getTruncateOrZeroExtend helper function, andChris Lattner2011-01-041-14/+6
| | | | | | | stop setting NSW: signed overflow is possible. Thanks to Dan for pointing these out. llvm-svn: 122790
* Fix comment.Owen Anderson2011-01-031-1/+1
| | | | llvm-svn: 122788
* Use the new addEscapingValue callback to update GlobalsModRef when GVN adds ↵Owen Anderson2011-01-031-2/+19
| | | | | | | | PHIs of GEPs. For the moment, have GlobalsModRef handle this conservatively by simply removing the value from its maps. llvm-svn: 122787
* Duncan deftly points out that readnone functions aren'tChris Lattner2011-01-031-1/+5
| | | | | | | invalidated by stores, so they can be handled as 'simple' operations. llvm-svn: 122785
* Simplify GVN's value expression structure, allowing the elimination of a lot of Owen Anderson2011-01-031-260/+26
| | | | | | almost-but-not-quite-identical code. No intended functionality change. llvm-svn: 122760
* stength reduce my previous patch a bit. The only instructionsChris Lattner2011-01-031-6/+9
| | | | | | | | | | | that are allowed to have metadata operands are intrinsic calls, and the only ones that take metadata currently return void. Just reject all void instructions, which should not be value numbered anyway. To future proof things, add an assert to the getHashValue impl for calls to check that metadata operands aren't present. llvm-svn: 122759
* fix PR8895: metadata operands don't have a strong use of theirChris Lattner2011-01-031-4/+10
| | | | | | | | | | nested values, so they can change and drop to null, which can change the hash and cause havok. It turns out that it isn't a good idea to value number stuff with metadata operands anyway, so... don't. llvm-svn: 122758
* Speed up instsimplify by about 10-15% by not bothering to retryDuncan Sands2011-01-031-8/+19
| | | | | | | InstructionSimplify on instructions that didn't change since the last time round the loop. llvm-svn: 122745
* Switch a worklist in CodeGenPrepare to SmallVector and increase the inlineCameron Zwarich2011-01-031-2/+2
| | | | | | | | | capacity on the Visited SmallPtrSet. On 403.gcc, this is about a 4.5% speedup of CodeGenPrepare time (which itself is 10% of time spent in the backend). This is progress towards PR8889. llvm-svn: 122741
* earlycse can do trivial with-a-block dead store Chris Lattner2011-01-031-6/+38
| | | | | | | elimination as well. This deletes 60 stores in 176.gcc that largely come from bitfield code. llvm-svn: 122736
* switch the load table to use a recycling bump pointer allocator,Chris Lattner2011-01-031-1/+4
| | | | | | speeding earlycse up by 6%. llvm-svn: 122733
* now that loads are in their own table, we can implementChris Lattner2011-01-031-1/+12
| | | | | | | store->load forwarding. This allows EarlyCSE to zap 600 more loads from 176.gcc. llvm-svn: 122732
* split loads and calls into separate tables. Loads are now just indexedChris Lattner2011-01-031-42/+74
| | | | | | by their pointer instead of using MemoryValue to wrap it. llvm-svn: 122731
* various cleanups, no functionality change.Chris Lattner2011-01-031-24/+19
| | | | llvm-svn: 122729
* Teach EarlyCSE to do trivial CSE of loads and read-only calls.Chris Lattner2011-01-031-22/+152
| | | | | | | On 176.gcc, this catches 13090 loads and calls, and increases the number of simple instructions CSE'd from 29658 to 36208. llvm-svn: 122727
* rename InstValue to SimpleValue, add some comments.Chris Lattner2011-01-031-26/+41
| | | | llvm-svn: 122725
* CMake: Add missing source file.Michael J. Spencer2011-01-031-0/+1
| | | | llvm-svn: 122724
* Allocate nodes for the scoped hash table from a recyling bump pointerChris Lattner2011-01-031-5/+9
| | | | | | allocator. This speeds up early cse by about 20% llvm-svn: 122723
* reduce redundancy in the hashing code and other misc cleanups.Chris Lattner2011-01-032-20/+24
| | | | llvm-svn: 122720
* Add a new loop-instsimplify pass, with the intention of replacing the instanceCameron Zwarich2011-01-033-0/+114
| | | | | | | of instcombine that is currently in the middle of the loop pass pipeline. This commit only checks in the pass; it will hopefully be enabled by default later. llvm-svn: 122719
* fix some pastosChris Lattner2011-01-021-4/+4
| | | | llvm-svn: 122718
* add DEBUG and -stats output to earlycse.Chris Lattner2011-01-022-6/+39
| | | | | | Teach it to CSE the rest of the non-side-effecting instructions. llvm-svn: 122716
* Enhance earlycse to do CSE of casts, instsimplify and die.Chris Lattner2011-01-021-4/+141
| | | | | | Add a testcase. llvm-svn: 122715
* split dom frontier handling stuff out to its own DominanceFrontier header,Chris Lattner2011-01-0212-31/+23
| | | | | | so that Dominators.h is *just* domtree. Also prune #includes a bit. llvm-svn: 122714
* sketch out a new early cse pass. No functionality yet.Chris Lattner2011-01-022-0/+63
| | | | llvm-svn: 122713
* fix a miscompilation of tramp3d-v4: when forming a memcpy, we have to makeChris Lattner2011-01-021-12/+23
| | | | | | | | sure that the loop we're promoting into a memcpy doesn't mutate the input of the memcpy. Before we were just checking that the dest of the memcpy wasn't mod/ref'd by the loop. llvm-svn: 122712
* If a loop iterates exactly once (has backedge count = 0) then don'tChris Lattner2011-01-021-0/+6
| | | | | | | mess with it. We'd rather peel/unroll it than convert all of its stores into memsets. llvm-svn: 122711
* Also remove functions that use complex constant expressions in terms ofNick Lewycky2011-01-021-5/+18
| | | | | | another function. llvm-svn: 122705
* enhance loop idiom recognition to scan *all* unconditionally executedChris Lattner2011-01-021-8/+39
| | | | | | | blocks in a loop, instead of just the header block. This makes it more aggressive, able to handle Duncan's Ada examples. llvm-svn: 122704
* make inSubLoop much more efficient.Chris Lattner2011-01-021-4/+1
| | | | llvm-svn: 122703
* rip out isExitBlockDominatedByBlockInLoop, calling DomTree::dominates instead.Chris Lattner2011-01-021-37/+4
| | | | | | | | isExitBlockDominatedByBlockInLoop is a relic of the days when domtree was *just* a tree and didn't have DFS numbers. Checking DFS numbers is faster and easier than "limiting the search of the tree". llvm-svn: 122702
* add a list of opportunities for future improvement.Chris Lattner2011-01-021-1/+22
| | | | llvm-svn: 122701
* Fix PR8702 by not having LoopSimplify claim to preserve LCSSA form. As ↵Duncan Sands2011-01-021-15/+12
| | | | | | | | | | described in the PR, the pass could break LCSSA form when inserting preheaders. It probably would be easy enough to fix this, but since currently we always go into LCSSA form after running this pass, doing so is not urgent. llvm-svn: 122695
* Allow loop-idiom to run on multiple BB loops, but still only scan the loop Chris Lattner2011-01-021-5/+5
| | | | | | | | | | | | | | | | | | header for now for memset/memcpy opportunities. It turns out that loop-rotate is successfully rotating loops, but *DOESN'T MERGE THE BLOCKS*, turning "for loops" into 2 basic block loops that loop-idiom was ignoring. With this fix, we form many *many* more memcpy and memsets than before, including on the "history" loops in the viterbi benchmark, which look like this: for (j=0; j<MAX_history; ++j) { history_new[i][j+1] = history[2*i][j]; } Transforming these loops into memcpy's speeds up the viterbi benchmark from 11.98s to 3.55s on my machine. Woo. llvm-svn: 122685
* remove debugging code.Chris Lattner2011-01-021-4/+0
| | | | llvm-svn: 122683
* add some -stats output.Chris Lattner2011-01-021-1/+10
| | | | llvm-svn: 122682
* improve loop rotation to use CodeMetrics to analyze theChris Lattner2011-01-022-17/+8
| | | | | | | size of a loop header instead of its own code size estimator. This allows it to handle bitcasts etc more precisely. llvm-svn: 122681
OpenPOWER on IntegriCloud