Evan Cheng [Wed, 5 Jan 2011 23:06:49 +0000 (23:06 +0000)]
Optimize:
r1025 = s/zext r1024, 4
r1026 = extract_subreg r1025, 4
to:
r1026 = copy r1024
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122925
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 5 Jan 2011 22:28:46 +0000 (22:28 +0000)]
fix PR8900, a shuffle miscompilation. Patch by Nadav Rotem!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122921
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 5 Jan 2011 22:26:52 +0000 (22:26 +0000)]
silence more self assignment warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122920
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 5 Jan 2011 21:50:24 +0000 (21:50 +0000)]
Add a hidden command line option to display edge bundle graphs as they are
calculated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122912
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 5 Jan 2011 21:50:21 +0000 (21:50 +0000)]
Silence a warning from non-standard warning avoidance code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122911
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 5 Jan 2011 21:45:56 +0000 (21:45 +0000)]
80-cols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122909
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Wed, 5 Jan 2011 21:37:18 +0000 (21:37 +0000)]
When computing the value on an edge, in certain cases LVI would fail to compute the value range
in the predecessor block, leading to an incorrect conclusion for the edge value. Found by inspection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122908
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Wed, 5 Jan 2011 21:16:50 +0000 (21:16 +0000)]
Revert svn 122743, removing the instcombine pass that was replaced by earlycse.
My i386 llvm-gcc nightly tester found a regression for
SingleSource/Benchmarks/McGill/chomp that a bisect blamed on 122743.
That seems strange but apparently the combination of earlycse and instcombine
did something bad. Chris says he intended to remove the instcombine pass, so
let's go ahead and try that. We'll see if there are any performance losses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122907
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Wed, 5 Jan 2011 21:15:29 +0000 (21:15 +0000)]
Re-convert several of LazyValueInfo's internal maps to Dense{Map|Set}, and fix the issue in
hasBlockValue() that was causing iterator invalidations. Many thanks to Dimitry Andric for
tracking down those invalidations!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122906
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 5 Jan 2011 18:41:05 +0000 (18:41 +0000)]
fix some -Wself-assign warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122893
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Zwarich [Wed, 5 Jan 2011 17:47:38 +0000 (17:47 +0000)]
Add some more statistics to CodeGenPrepare.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122891
91177308-0d34-0410-b5e6-
96231b3b80d8
Wesley Peck [Wed, 5 Jan 2011 17:34:20 +0000 (17:34 +0000)]
Commit 122778 broke DWARF debug output when using the MBlaze backend. Fixed by overriding TargetFrameInfo::getFrameIndexOffset to take into account the new frame index information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122889
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Zwarich [Wed, 5 Jan 2011 17:27:27 +0000 (17:27 +0000)]
Add some stats to CodeGenPrepare to make it easier to speed it up without
regressing code quality.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122887
91177308-0d34-0410-b5e6-
96231b3b80d8
Wesley Peck [Wed, 5 Jan 2011 17:01:57 +0000 (17:01 +0000)]
Fix small bug in setDebugInfoAvailability.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122886
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Wed, 5 Jan 2011 16:39:46 +0000 (16:39 +0000)]
UnitTests/Path: Fix typo, add error number, and enable the directory cleanup code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122885
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Wed, 5 Jan 2011 16:39:38 +0000 (16:39 +0000)]
Support/PathV2: Implement remove_all.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122884
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Wed, 5 Jan 2011 16:39:30 +0000 (16:39 +0000)]
Support/Windows/PathV2: Make directory iteration ignore . and ..
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122883
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Wed, 5 Jan 2011 16:39:22 +0000 (16:39 +0000)]
Support/Windows/PathV2: Fix remove to handle both files and directories.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122882
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Wed, 5 Jan 2011 16:39:13 +0000 (16:39 +0000)]
Support/PathV2: Implement directory_entry::status.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122881
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Wed, 5 Jan 2011 16:39:05 +0000 (16:39 +0000)]
UnitTests/PathV2: Setup a test fixture to make tracking created file system
entities easier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122880
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Wed, 5 Jan 2011 16:38:57 +0000 (16:38 +0000)]
Support/PathV2: Implement directory iteration on POSIX.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122879
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Zwarich [Wed, 5 Jan 2011 16:08:47 +0000 (16:08 +0000)]
Use pop_back_val instead of back followed by pop_back.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122876
91177308-0d34-0410-b5e6-
96231b3b80d8
Frits van Bommel [Wed, 5 Jan 2011 15:10:24 +0000 (15:10 +0000)]
Fix lit for people whose LLVM path contains 'opt', which is a common directory name on Unix-like systems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122873
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Zwarich [Wed, 5 Jan 2011 05:47:47 +0000 (05:47 +0000)]
Use a worklist for later iterations just like ordinary instsimplify. The next
step is to only process instructions in subloops if they have been modified by
an earlier simplification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122869
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Zwarich [Wed, 5 Jan 2011 05:15:53 +0000 (05:15 +0000)]
Change LoopInstSimplify back to a LoopPass. It revisits subloops rather than
skipping them, but it should probably use a worklist and only revisit those
instructions in subloops that have actually changed. It should probably also
use a worklist after the first iteration like instsimplify now does. Regardless,
it's only 0.3% of opt -O2 time on 403.gcc if it replaces the instcombine placed
in the middle of the loop passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122868
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 5 Jan 2011 01:03:32 +0000 (01:03 +0000)]
Fix PR8906: -fno-builtin should disable loop-idiom recognition.
It forms memset and memcpy's, and will someday form popcount and
other stuff. All of this is bad when compiling the implementation
of memset, memcpy, popcount, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122854
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 4 Jan 2011 22:31:50 +0000 (22:31 +0000)]
Remove TODO, these appear to be implemented.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122849
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 4 Jan 2011 22:15:21 +0000 (22:15 +0000)]
Don't bother value numbering instructions with void types in GVN. In theory this should allow us to insert
fewer things into the value numbering maps, but any speedup is beneath the noise threshold on my machine
on 403.gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122844
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Tue, 4 Jan 2011 21:10:11 +0000 (21:10 +0000)]
Use the EdgeBundles analysis in X86FloatingPoint instead of recomputing CFG
bundles in the pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122833
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Tue, 4 Jan 2011 21:10:05 +0000 (21:10 +0000)]
Turn the EdgeBundles class into a stand-alone machine CFG analysis pass.
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122832
91177308-0d34-0410-b5e6-
96231b3b80d8
Dale Johannesen [Tue, 4 Jan 2011 19:31:24 +0000 (19:31 +0000)]
Eliminate a warning compiling with llvm-gcc. (IMO the
warning is overzealous but gcc is what it is.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122829
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 4 Jan 2011 19:29:46 +0000 (19:29 +0000)]
Complete the NumberTable --> LeaderTable rename.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122828
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 4 Jan 2011 19:25:18 +0000 (19:25 +0000)]
Fix typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122827
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 4 Jan 2011 19:24:57 +0000 (19:24 +0000)]
Prune #include's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122826
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 4 Jan 2011 19:13:25 +0000 (19:13 +0000)]
Clarify terminology, settling on referring to what was the "number table" as the "leader table", and
rename methods to make it much more clear what they're doing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122823
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 4 Jan 2011 19:10:54 +0000 (19:10 +0000)]
When removing a value from GVN's leaders list, don't drop the Next pointer in a corner case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122822
91177308-0d34-0410-b5e6-
96231b3b80d8
Dale Johannesen [Tue, 4 Jan 2011 19:01:54 +0000 (19:01 +0000)]
Improve the accuracy of the inlining heuristic looking for the
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122821
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 4 Jan 2011 18:54:18 +0000 (18:54 +0000)]
Branch instructions don't produce values, so there's no need to generate a 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122819
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 4 Jan 2011 18:22:08 +0000 (18:22 +0000)]
Remove commented out code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122817
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 4 Jan 2011 18:21:18 +0000 (18:21 +0000)]
Give MachineFunctionAnalysis a getPassName() implementation to make timing reports prettier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122816
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Zwarich [Tue, 4 Jan 2011 18:19:19 +0000 (18:19 +0000)]
Switch to the new style of asterisk placement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122815
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 4 Jan 2011 18:19:15 +0000 (18:19 +0000)]
fix an off-by-one bug that caused a crash analyzing
ashr's with huge shift amounts, PR8896
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122814
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Tue, 4 Jan 2011 17:00:18 +0000 (17:00 +0000)]
UnitTests/Path: Produce useful diagnostics on error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122812
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Zwarich [Tue, 4 Jan 2011 16:24:51 +0000 (16:24 +0000)]
Switch to path halving from path compression for a small speedup. This also
makes getLeader() nonrecursive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122811
91177308-0d34-0410-b5e6-
96231b3b80d8
Tobias Grosser [Tue, 4 Jan 2011 16:01:17 +0000 (16:01 +0000)]
Include llvm-gcc dir before llvm_tools_dir
This ensures that always the recently compiled tools are picked for testing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122810
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Tue, 4 Jan 2011 12:52:29 +0000 (12:52 +0000)]
These methods should be "const"; make them so.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122809
91177308-0d34-0410-b5e6-
96231b3b80d8
Francois Pichet [Tue, 4 Jan 2011 10:23:42 +0000 (10:23 +0000)]
Disable r122754 on Windows: was causing all lit tests to fail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122808
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 4 Jan 2011 07:46:33 +0000 (07:46 +0000)]
Teach loop-idiom to turn a loop containing a memset into a larger memset
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122806
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 4 Jan 2011 07:27:30 +0000 (07:27 +0000)]
restructure this a bit. Initialize the WeakVH with "I", the
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122805
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Zwarich [Tue, 4 Jan 2011 06:42:27 +0000 (06:42 +0000)]
Eliminate repeated allocation of a per-BB DenseMap for a 4.6% reduction of time
spent in StrongPHIElimination on 403.gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122803
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Zwarich [Tue, 4 Jan 2011 04:43:31 +0000 (04:43 +0000)]
Avoid finding loop back edges when we are not splitting critical edges in
CodeGenPrepare (which is the default behavior).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122801
91177308-0d34-0410-b5e6-
96231b3b80d8
David Greene [Tue, 4 Jan 2011 01:05:30 +0000 (01:05 +0000)]
Don't pattern match "/clang" so we don't mangle directory names. Some
tests use absolute paths to clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122796
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 4 Jan 2011 00:55:21 +0000 (00:55 +0000)]
Clean up a funky pass registration that got passed over when I got rid of static constructors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122795
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Tue, 4 Jan 2011 00:32:57 +0000 (00:32 +0000)]
Fix the ARM IIC_iCMPsi itinerary and add an important assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122794
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Zwarich [Tue, 4 Jan 2011 00:12:46 +0000 (00:12 +0000)]
Address most of Duncan's review comments. Also, make LoopInstSimplify a simple
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122791
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 4 Jan 2011 00:06:55 +0000 (00:06 +0000)]
use the very-handy getTruncateOrZeroExtend helper function, and
stop setting NSW: signed overflow is possible. Thanks to Dan
for pointing these out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122790
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Mon, 3 Jan 2011 23:59:05 +0000 (23:59 +0000)]
Formatting changes. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122789
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Mon, 3 Jan 2011 23:51:56 +0000 (23:51 +0000)]
Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122788
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Mon, 3 Jan 2011 23:51:43 +0000 (23:51 +0000)]
Use the new addEscapingValue callback to update GlobalsModRef when GVN adds PHIs of GEPs. For the moment,
have GlobalsModRef handle this conservatively by simply removing the value from its maps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122787
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Mon, 3 Jan 2011 23:47:14 +0000 (23:47 +0000)]
Convert MC tests to .s so codegen changes won't break them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122786
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 3 Jan 2011 23:38:13 +0000 (23:38 +0000)]
Duncan deftly points out that readnone functions aren't
invalidated by stores, so they can be handled as 'simple'
operations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122785
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Mon, 3 Jan 2011 22:53:22 +0000 (22:53 +0000)]
Use pushq / popq instead of subq $8, %rsp / addq $8, %rsp to adjust stack in
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122783
91177308-0d34-0410-b5e6-
96231b3b80d8
David Greene [Mon, 3 Jan 2011 21:55:08 +0000 (21:55 +0000)]
Don't pattern match "clang-" as it may be part of a tool name with a
triple suffix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122779
91177308-0d34-0410-b5e6-
96231b3b80d8
Wesley Peck [Mon, 3 Jan 2011 21:40:26 +0000 (21:40 +0000)]
Fix more stack layout issues in the MBlaze backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122778
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Mon, 3 Jan 2011 21:38:41 +0000 (21:38 +0000)]
Stub out a new updating interface to AliasAnalysis, allowing stateful 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122777
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Mon, 3 Jan 2011 21:08:22 +0000 (21:08 +0000)]
We can count properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122773
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 3 Jan 2011 21:03:33 +0000 (21:03 +0000)]
fix rdar://
8813415 - a miscompilation of 164.gzip that loop-idiom
exposed. It turns out to be a latent bug in basicaa, scary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122772
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 3 Jan 2011 21:01:26 +0000 (21:01 +0000)]
filecheckize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122771
91177308-0d34-0410-b5e6-
96231b3b80d8
Oscar Fuentes [Mon, 3 Jan 2011 20:01:32 +0000 (20:01 +0000)]
TableGen.cmake: sometimes the .td file is not in the current directory
(clang/include/clang/Basic/StmtNodes.td, for instance, is tablegenned
from clang/include/clang/AST/CMakeLists.txt) so it is not contained on
the list of all .td files on the current source directory which is
used as the DEPENDS of the custom command. We must add the .td file to
the DEPENDS list of the custom command. Otherwise some .inc files are
not regenerated when the corresponding .td file changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122768
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Mon, 3 Jan 2011 19:00:11 +0000 (19:00 +0000)]
Simplify GVN's value expression structure, allowing the elimination of a lot of
almost-but-not-quite-identical code. No intended functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122760
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 3 Jan 2011 18:43:03 +0000 (18:43 +0000)]
stength reduce my previous patch a bit. The only instructions
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122759
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 3 Jan 2011 18:28:15 +0000 (18:28 +0000)]
fix PR8895: metadata operands don't have a strong use of their
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122758
91177308-0d34-0410-b5e6-
96231b3b80d8
David Greene [Mon, 3 Jan 2011 17:30:25 +0000 (17:30 +0000)]
Reapply 122341 to fix PR8199 now that clang changes are in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122754
91177308-0d34-0410-b5e6-
96231b3b80d8
Oscar Fuentes [Mon, 3 Jan 2011 16:59:52 +0000 (16:59 +0000)]
LLVMProcessSources: add .def files along with .h files to targets for
the benefit of project-based generators (VS, XCode, etc).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122749
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Mon, 3 Jan 2011 10:50:04 +0000 (10:50 +0000)]
Speed up instsimplify by about 10-15% by not bothering to retry
InstructionSimplify on instructions that didn't change since the
last time round the loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122745
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Mon, 3 Jan 2011 07:53:18 +0000 (07:53 +0000)]
Undo what looks like accidental removal of an instcombine pass in r122740.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122743
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Zwarich [Mon, 3 Jan 2011 06:33:01 +0000 (06:33 +0000)]
Switch a worklist in CodeGenPrepare to SmallVector and increase the inline
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122741
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 3 Jan 2011 06:19:09 +0000 (06:19 +0000)]
Turn on earlycse by default. This seems to be a small performance
improvement in the generated code, and speeds up 'opt -std-compile-opts'
compile time on 176.gcc from 24.84s to 23.2s (about 7%).
This also resolves a specific code quality issue in rdar://
7352081 which
was generating poor code for:
int t(int a, int b) {
if (a & b & 1)
return a & b;
return 3;
}
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122740
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Mon, 3 Jan 2011 06:16:07 +0000 (06:16 +0000)]
Further expand what a call graph pass may do.
The rationale is that after analyzing a function in the SCC, we may want to
modify it in a way that requires us to update its uses (f.e. to replace the
call with a constant) or its users (f.e. to call it with fewer arguments).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122739
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 3 Jan 2011 04:17:24 +0000 (04:17 +0000)]
earlycse can do trivial with-a-block dead store
elimination as well. This deletes 60 stores in 176.gcc
that largely come from bitfield code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122736
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Zwarich [Mon, 3 Jan 2011 04:07:46 +0000 (04:07 +0000)]
Use a RecyclingAllocator to allocate values for MachineCSE's ScopedHashTable for
a 28% speedup of MachineCSE time on 403.gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122735
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Mon, 3 Jan 2011 04:01:44 +0000 (04:01 +0000)]
Permit CallGraphSCCPasses readonly access to the direct callers of the functions
in their SCC as they already have with the direct callees.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122734
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 3 Jan 2011 03:53:50 +0000 (03:53 +0000)]
switch the load table to use a recycling bump pointer allocator,
speeding earlycse up by 6%.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122733
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 3 Jan 2011 03:46:34 +0000 (03:46 +0000)]
now that loads are in their own table, we can implement
store->load forwarding. This allows EarlyCSE to zap 600 more
loads from 176.gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122732
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 3 Jan 2011 03:41:27 +0000 (03:41 +0000)]
split loads and calls into separate tables. Loads are now just indexed
by their pointer instead of using MemoryValue to wrap it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122731
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 3 Jan 2011 03:33:47 +0000 (03:33 +0000)]
add a testcase for readonly call CSE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122730
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 3 Jan 2011 03:28:23 +0000 (03:28 +0000)]
various cleanups, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122729
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Mon, 3 Jan 2011 03:19:35 +0000 (03:19 +0000)]
Add spliceFunction to the CallGraph interface. This allows users to efficiently
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122728
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 3 Jan 2011 03:18:43 +0000 (03:18 +0000)]
Teach EarlyCSE to do trivial CSE of loads and read-only calls.
On 176.gcc, this catches 13090 loads and calls, and increases the
number of simple instructions CSE'd from 29658 to 36208.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122727
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 3 Jan 2011 03:16:20 +0000 (03:16 +0000)]
add a handy typedef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122726
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 3 Jan 2011 02:20:48 +0000 (02:20 +0000)]
rename InstValue to SimpleValue, add some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122725
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Mon, 3 Jan 2011 02:13:05 +0000 (02:13 +0000)]
CMake: Add missing source file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122724
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 3 Jan 2011 01:42:46 +0000 (01:42 +0000)]
Allocate nodes for the scoped hash table from a recyling bump pointer
allocator. This speeds up early cse by about 20%
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122723
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 3 Jan 2011 01:38:29 +0000 (01:38 +0000)]
really get this working with a custom allocator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122722
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 3 Jan 2011 01:29:37 +0000 (01:29 +0000)]
Enhance ScopedHashTable to allow it to take an allocator argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122721
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 3 Jan 2011 01:10:08 +0000 (01:10 +0000)]
reduce redundancy in the hashing code and other misc cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122720
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Zwarich [Mon, 3 Jan 2011 00:25:16 +0000 (00:25 +0000)]
Add a new loop-instsimplify pass, with the intention of replacing the instance
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122719
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 2 Jan 2011 23:29:58 +0000 (23:29 +0000)]
fix some pastos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122718
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 2 Jan 2011 23:19:45 +0000 (23:19 +0000)]
add DEBUG and -stats output to earlycse.
Teach it to CSE the rest of the non-side-effecting instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122716
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 2 Jan 2011 23:04:14 +0000 (23:04 +0000)]
Enhance earlycse to do CSE of casts, instsimplify and die.
Add a testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122715
91177308-0d34-0410-b5e6-
96231b3b80d8