aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
AgeCommit message (Collapse)AuthorFilesLines
2011-01-04Turn the EdgeBundles class into a stand-alone machine CFG analysis pass.Jakob Stoklund Olesen5-88/+84
The analysis will be needed by both the greedy register allocator and the X86FloatingPoint pass. It only needs to be computed once when the CFG doesn't change. This pass is very fast, usually showing up as 0.0% wall time. llvm-svn: 122832
2011-01-04Eliminate a warning compiling with llvm-gcc. (IMO theDale Johannesen1-1/+1
warning is overzealous but gcc is what it is.) llvm-svn: 122829
2011-01-04Complete the NumberTable --> LeaderTable rename.Owen Anderson1-12/+12
llvm-svn: 122828
2011-01-04Fix typo in a comment.Owen Anderson1-1/+1
llvm-svn: 122827
2011-01-04Prune #include's.Owen Anderson1-10/+0
llvm-svn: 122826
2011-01-04Clarify terminology, settling on referring to what was the "number table" as ↵Owen Anderson1-32/+32
the "leader table", and rename methods to make it much more clear what they're doing. llvm-svn: 122823
2011-01-04When removing a value from GVN's leaders list, don't drop the Next pointer ↵Owen Anderson1-1/+2
in a corner case. llvm-svn: 122822
2011-01-04Improve the accuracy of the inlining heuristic looking for theDale Johannesen1-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
2011-01-04Branch instructions don't produce values, so there's no need to generate a ↵Owen Anderson1-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
2011-01-04Remove commented out code.Owen Anderson1-4/+0
llvm-svn: 122817
2011-01-04Switch to the new style of asterisk placement.Cameron Zwarich1-8/+8
llvm-svn: 122815
2011-01-04fix an off-by-one bug that caused a crash analyzingChris Lattner1-1/+1
ashr's with huge shift amounts, PR8896 llvm-svn: 122814
2011-01-04Switch to path halving from path compression for a small speedup. This alsoCameron Zwarich1-6/+12
makes getLeader() nonrecursive. llvm-svn: 122811
2011-01-04These methods should be "const"; make them so.Duncan Sands1-4/+4
llvm-svn: 122809
2011-01-04Teach loop-idiom to turn a loop containing a memset into a larger memsetChris Lattner1-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
2011-01-04restructure this a bit. Initialize the WeakVH with "I", theChris Lattner1-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
2011-01-04Eliminate repeated allocation of a per-BB DenseMap for a 4.6% reduction of timeCameron Zwarich1-6/+5
spent in StrongPHIElimination on 403.gcc. llvm-svn: 122803
2011-01-04Avoid finding loop back edges when we are not splitting critical edges inCameron Zwarich1-2/+4
CodeGenPrepare (which is the default behavior). llvm-svn: 122801
2011-01-04Clean up a funky pass registration that got passed over when I got rid of ↵Owen Anderson1-7/+1
static constructors. llvm-svn: 122795
2011-01-04Fix the ARM IIC_iCMPsi itinerary and add an important assert.Andrew Trick2-1/+3
llvm-svn: 122794
2011-01-04Address most of Duncan's review comments. Also, make LoopInstSimplify a simpleCameron Zwarich1-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
2011-01-04use the very-handy getTruncateOrZeroExtend helper function, andChris Lattner1-14/+6
stop setting NSW: signed overflow is possible. Thanks to Dan for pointing these out. llvm-svn: 122790
2011-01-03Formatting changes. No functionality change.Bill Wendling1-80/+77
llvm-svn: 122789
2011-01-03Fix comment.Owen Anderson1-1/+1
llvm-svn: 122788
2011-01-03Use the new addEscapingValue callback to update GlobalsModRef when GVN adds ↵Owen Anderson3-2/+31
PHIs of GEPs. For the moment, have GlobalsModRef handle this conservatively by simply removing the value from its maps. llvm-svn: 122787
2011-01-03Duncan deftly points out that readnone functions aren'tChris Lattner1-1/+5
invalidated by stores, so they can be handled as 'simple' operations. llvm-svn: 122785
2011-01-03Use pushq / popq instead of subq $8, %rsp / addq $8, %rsp to adjust stack inEvan Cheng2-11/+88
prologue and epilogue if the adjustment is 8. Similarly, use pushl / popl if the adjustment is 4 in 32-bit mode. In the epilogue, takes care to pop to a caller-saved register that's not live at the exit (either return or tailcall instruction). rdar://8771137 llvm-svn: 122783
2011-01-03Fix more stack layout issues in the MBlaze backend.Wesley Peck3-25/+40
llvm-svn: 122778
2011-01-03Stub out a new updating interface to AliasAnalysis, allowing stateful ↵Owen Anderson1-0/+6
analyses to be informed when a pointer value has potentially become escaping. Implementations can choose to either fall back to conservative responses for that value, or may recompute their analysis to accomodate the change. llvm-svn: 122777
2011-01-03fix rdar://8813415 - a miscompilation of 164.gzip that loop-idiomChris Lattner1-0/+2
exposed. It turns out to be a latent bug in basicaa, scary. llvm-svn: 122772
2011-01-03Simplify GVN's value expression structure, allowing the elimination of a lot of Owen Anderson1-260/+26
almost-but-not-quite-identical code. No intended functionality change. llvm-svn: 122760
2011-01-03stength reduce my previous patch a bit. The only instructionsChris Lattner1-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
2011-01-03fix PR8895: metadata operands don't have a strong use of theirChris Lattner1-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
2011-01-03Speed up instsimplify by about 10-15% by not bothering to retryDuncan Sands1-8/+19
InstructionSimplify on instructions that didn't change since the last time round the loop. llvm-svn: 122745
2011-01-03Switch a worklist in CodeGenPrepare to SmallVector and increase the inlineCameron Zwarich1-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
2011-01-03earlycse can do trivial with-a-block dead store Chris Lattner1-6/+38
elimination as well. This deletes 60 stores in 176.gcc that largely come from bitfield code. llvm-svn: 122736
2011-01-03Use a RecyclingAllocator to allocate values for MachineCSE's ScopedHashTable forCameron Zwarich1-3/+7
a 28% speedup of MachineCSE time on 403.gcc. llvm-svn: 122735
2011-01-03switch the load table to use a recycling bump pointer allocator,Chris Lattner1-1/+4
speeding earlycse up by 6%. llvm-svn: 122733
2011-01-03now that loads are in their own table, we can implementChris Lattner1-1/+12
store->load forwarding. This allows EarlyCSE to zap 600 more loads from 176.gcc. llvm-svn: 122732
2011-01-03split loads and calls into separate tables. Loads are now just indexedChris Lattner1-42/+74
by their pointer instead of using MemoryValue to wrap it. llvm-svn: 122731
2011-01-03various cleanups, no functionality change.Chris Lattner1-24/+19
llvm-svn: 122729
2011-01-03Add spliceFunction to the CallGraph interface. This allows users to efficientlyNick Lewycky1-1/+15
update a callGraph when performing the common operation of splicing the body to a new function and updating all callers (such as via RAUW). No users yet, though this is intended for DeadArgumentElimination as part of PR8887. llvm-svn: 122728
2011-01-03Teach EarlyCSE to do trivial CSE of loads and read-only calls.Chris Lattner1-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
2011-01-03rename InstValue to SimpleValue, add some comments.Chris Lattner1-26/+41
llvm-svn: 122725
2011-01-03CMake: Add missing source file.Michael J. Spencer1-0/+1
llvm-svn: 122724
2011-01-03Allocate nodes for the scoped hash table from a recyling bump pointerChris Lattner1-5/+9
allocator. This speeds up early cse by about 20% llvm-svn: 122723
2011-01-03reduce redundancy in the hashing code and other misc cleanups.Chris Lattner2-20/+24
llvm-svn: 122720
2011-01-03Add a new loop-instsimplify pass, with the intention of replacing the instanceCameron Zwarich3-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
2011-01-02fix some pastosChris Lattner1-4/+4
llvm-svn: 122718
2011-01-02add DEBUG and -stats output to earlycse.Chris Lattner2-6/+39
Teach it to CSE the rest of the non-side-effecting instructions. llvm-svn: 122716