Chris Lattner [Wed, 8 Aug 2007 05:51:24 +0000 (05:51 +0000)]
reimplement dfs number computation to be significantly faster. This speeds up
natural loop canonicalization (which does many cfg xforms) by 4.3x, for
example. This also fixes a bug in postdom dfnumber computation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40920
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Wed, 8 Aug 2007 04:52:29 +0000 (04:52 +0000)]
First round of cleanups from Chris' feedback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40919
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Wed, 8 Aug 2007 03:00:28 +0000 (03:00 +0000)]
- Each val# can have multiple kills.
- Fix some minor bugs related to special markers on val# def. ~0U means
undefined, ~1U means dead val#.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40916
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Wed, 8 Aug 2007 01:51:27 +0000 (01:51 +0000)]
Embrace patch review feedback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40915
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Wed, 8 Aug 2007 01:00:21 +0000 (01:00 +0000)]
Remove a dead assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40914
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 7 Aug 2007 23:49:57 +0000 (23:49 +0000)]
- LiveInterval value#'s now have 3 components: def instruction #,
kill instruction #, and source register number (iff the value# is defined by a
copy).
- Now def instruction # is set for every value#, not just for copy defined ones.
- Update some outdated code related inactive live ranges.
- Kill info not yet set. That's next patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40913
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Tue, 7 Aug 2007 23:17:52 +0000 (23:17 +0000)]
Fix new compare instruction's signness. Caught by Chris during review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40912
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Tue, 7 Aug 2007 23:16:03 +0000 (23:16 +0000)]
Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40911
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 7 Aug 2007 23:12:31 +0000 (23:12 +0000)]
Don't insert nearly as many redundant phi nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40909
91177308-0d34-0410-b5e6-
96231b3b80d8
Dale Johannesen [Tue, 7 Aug 2007 23:08:00 +0000 (23:08 +0000)]
Fix spelling of mtvscr and mfvscr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40908
91177308-0d34-0410-b5e6-
96231b3b80d8
Dale Johannesen [Tue, 7 Aug 2007 20:29:26 +0000 (20:29 +0000)]
Long double patch 8 of N: make it partially work in
SSE mode (all but conversions <-> other FP types, I think):
>>Do not mark all-80-bit operations as "Requires[FPStack]"
(which really means "not SSE").
>>Refactor load-and-extend to facilitate this.
>>Update comments.
>>Handle long double in SSE when computing FP_REG_KILL.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40906
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Tue, 7 Aug 2007 17:57:36 +0000 (17:57 +0000)]
Who thought up this crazy formatting scheme?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40905
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Tue, 7 Aug 2007 17:48:56 +0000 (17:48 +0000)]
Okay, over/back tags don't next.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40904
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Tue, 7 Aug 2007 17:45:35 +0000 (17:45 +0000)]
Use eraseFromParent().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40903
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Tue, 7 Aug 2007 17:43:48 +0000 (17:43 +0000)]
Try an indent level for better formatting.
Add the -version option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40902
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Tue, 7 Aug 2007 17:12:43 +0000 (17:12 +0000)]
Add the code generation options.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40900
91177308-0d34-0410-b5e6-
96231b3b80d8
David Greene [Tue, 7 Aug 2007 16:57:55 +0000 (16:57 +0000)]
Make this code more efficient
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40899
91177308-0d34-0410-b5e6-
96231b3b80d8
David Greene [Tue, 7 Aug 2007 16:52:03 +0000 (16:52 +0000)]
Fix comment typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40898
91177308-0d34-0410-b5e6-
96231b3b80d8
David Greene [Tue, 7 Aug 2007 16:44:38 +0000 (16:44 +0000)]
Fix GLIBCXX_DEBUG error triggered by incrementing erased iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40897
91177308-0d34-0410-b5e6-
96231b3b80d8
David Greene [Tue, 7 Aug 2007 16:34:05 +0000 (16:34 +0000)]
Add a missing forward declaration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40896
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Tue, 7 Aug 2007 16:29:57 +0000 (16:29 +0000)]
Rearrange options into sections and add the last floating point related option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40895
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Tue, 7 Aug 2007 16:23:42 +0000 (16:23 +0000)]
Add the -disable-excess-fp-precision option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40894
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Tue, 7 Aug 2007 16:21:52 +0000 (16:21 +0000)]
Add another missing option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40893
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Tue, 7 Aug 2007 16:11:57 +0000 (16:11 +0000)]
Add some more missing options.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40892
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Tue, 7 Aug 2007 15:48:16 +0000 (15:48 +0000)]
Remove the -f option which is no longer supported, but add the -fake-argv0
option which is similar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40891
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Tue, 7 Aug 2007 14:34:28 +0000 (14:34 +0000)]
Describe the global/local naming convention.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40890
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Tue, 7 Aug 2007 12:27:03 +0000 (12:27 +0000)]
Add reference to problem report.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40889
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 7 Aug 2007 01:37:15 +0000 (01:37 +0000)]
Initial JIT support for ARM by Raul Fernandes Herbster.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40887
91177308-0d34-0410-b5e6-
96231b3b80d8
Dale Johannesen [Tue, 7 Aug 2007 01:17:37 +0000 (01:17 +0000)]
Long double patch 7 of N, unless I lost count:).
Last x87 bits for full functionality (not
thoroughly tested, and long doubles do not work
in SSE modes at all - use -mcpu=i486 for now)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40886
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 7 Aug 2007 00:38:16 +0000 (00:38 +0000)]
Get rid of unnecessary #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40885
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 7 Aug 2007 00:33:45 +0000 (00:33 +0000)]
Clean up a bunch of caching stuff in memdep. This reduces the time to run GVN
on 403.gcc from ~15s to ~10s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40884
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Tue, 7 Aug 2007 00:25:56 +0000 (00:25 +0000)]
Begin loop index split pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40883
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Mon, 6 Aug 2007 23:26:03 +0000 (23:26 +0000)]
Improve the accuracy of memdep for determining the dependencies of loads.
This brings GVN to parity with GCSE+LoadVN.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40882
91177308-0d34-0410-b5e6-
96231b3b80d8
Dale Johannesen [Mon, 6 Aug 2007 22:10:35 +0000 (22:10 +0000)]
Replace 4-line function with 10-line version per review comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40881
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 6 Aug 2007 22:03:19 +0000 (22:03 +0000)]
remove #if 0 code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40880
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 6 Aug 2007 22:01:53 +0000 (22:01 +0000)]
remove #if 0 code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40879
91177308-0d34-0410-b5e6-
96231b3b80d8
Dale Johannesen [Mon, 6 Aug 2007 21:48:35 +0000 (21:48 +0000)]
Move lengthy conditional down 1 level per review comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40878
91177308-0d34-0410-b5e6-
96231b3b80d8
Dale Johannesen [Mon, 6 Aug 2007 21:31:06 +0000 (21:31 +0000)]
Get X86 long double calling convention to work
(on Darwin, anyway). Fix some table omissions for
LD arithmetic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40877
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 6 Aug 2007 21:00:46 +0000 (21:00 +0000)]
regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40875
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 6 Aug 2007 21:00:37 +0000 (21:00 +0000)]
Fix PR1577, a crash on invalid bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40874
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 6 Aug 2007 20:57:16 +0000 (20:57 +0000)]
This resolves a regression of BasicAA which failed to find any memory information for overloaded intrinsics (PR1600). This resolves that issue, and improves the matching scheme to use a BitVector rather than a binary search.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40872
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 6 Aug 2007 20:52:17 +0000 (20:52 +0000)]
This fixes resizing issues with BitVectors. It ensures that the BitWord type and type size is always used, and ensures completely correct clearing of unused high bits, and setting of bits when resizing. It should resolve PR1563.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40871
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Mon, 6 Aug 2007 20:04:16 +0000 (20:04 +0000)]
It's safe to fold not of fcmp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40870
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Mon, 6 Aug 2007 20:00:11 +0000 (20:00 +0000)]
Fix the dates on these tests. It's not September yet. Thanks Reid!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40869
91177308-0d34-0410-b5e6-
96231b3b80d8
Dale Johannesen [Mon, 6 Aug 2007 19:50:32 +0000 (19:50 +0000)]
Make 80-bit store maintain simulated FP stack correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40868
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Mon, 6 Aug 2007 19:21:00 +0000 (19:21 +0000)]
Let scalar-evolution analyze loops with an unsigned comparison for the exit
condition. Fixes 1597.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40867
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Mon, 6 Aug 2007 18:33:46 +0000 (18:33 +0000)]
Don't assume it's safe to transform a loop just because it's dominated by any
comparison. Fixes bug 1598.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40866
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Mon, 6 Aug 2007 17:10:29 +0000 (17:10 +0000)]
@verbatim needs to be on a line by itself.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40865
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 6 Aug 2007 16:36:18 +0000 (16:36 +0000)]
Fix a regression compiling 2005-05-11-Popcount-ffs-fls with the CBE,
introduced by chandler's patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40864
91177308-0d34-0410-b5e6-
96231b3b80d8
Christopher Lamb [Mon, 6 Aug 2007 16:33:56 +0000 (16:33 +0000)]
Implement review feedback. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40863
91177308-0d34-0410-b5e6-
96231b3b80d8
David Greene [Mon, 6 Aug 2007 15:09:17 +0000 (15:09 +0000)]
Make this code more efficient.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40861
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 6 Aug 2007 06:21:06 +0000 (06:21 +0000)]
remove some dead lines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40859
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 6 Aug 2007 06:19:47 +0000 (06:19 +0000)]
1. Random tidiness cleanups
2. Make domtree printing print dfin/dfout #'s
3. Fix the Transforms/LoopSimplify/2004-04-13-LoopSimplifyUpdateDomFrontier.ll failure from last night (in DominanceFrontier::splitBlock).
w.r.t. #3, my patches last night happened to expose the bug, but this
has been broken since Owen's r35839 patch to LoopSimplify. The code
was subsequently moved over from LoopSimplify into Dominators, carrying
the latent bug. Fun stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40858
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 6 Aug 2007 06:17:08 +0000 (06:17 +0000)]
update for new domtree dump format
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40857
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 6 Aug 2007 06:15:43 +0000 (06:15 +0000)]
Various random cleanups, add two accessors to DomTreeNode: getDFSNumIn/getDFSNumOut
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40856
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Sun, 5 Aug 2007 23:43:44 +0000 (23:43 +0000)]
Update links to the command guide generated documentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40855
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Sun, 5 Aug 2007 20:06:04 +0000 (20:06 +0000)]
Fix minor doxygen nits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40854
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Sun, 5 Aug 2007 19:51:03 +0000 (19:51 +0000)]
Comment out configuration tags not supported by doxygen 1.3.9
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40853
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Sun, 5 Aug 2007 19:36:39 +0000 (19:36 +0000)]
Document a missing parameter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40852
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Sun, 5 Aug 2007 19:35:22 +0000 (19:35 +0000)]
Silence some warnings from doxygen about @param argument name not matching the
actual argument name of the documented function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40851
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Sun, 5 Aug 2007 19:33:11 +0000 (19:33 +0000)]
Escape some escapes that confuse doxygen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40850
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Sun, 5 Aug 2007 19:27:01 +0000 (19:27 +0000)]
Fix a doxygen directive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40849
91177308-0d34-0410-b5e6-
96231b3b80d8
Dale Johannesen [Sun, 5 Aug 2007 18:49:15 +0000 (18:49 +0000)]
Long double patch 4 of N: initial x87 implementation.
Lots of problems yet but some simple things work.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40847
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Aug 2007 18:48:18 +0000 (18:48 +0000)]
allow this to pass on ppc hosts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40846
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Aug 2007 18:45:33 +0000 (18:45 +0000)]
shorten this name
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40843
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Aug 2007 08:47:58 +0000 (08:47 +0000)]
at the end of instcombine, explicitly clear WorklistMap.
This shrinks it down to something small. On the testcase
from PR1432, this speeds up instcombine from 0.7959s to 0.5000s,
(59%)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40840
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Aug 2007 08:43:36 +0000 (08:43 +0000)]
Fix a bug in DenseMap::clear, where we never reset a tombstone
to EmptyKey.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40839
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Aug 2007 07:50:06 +0000 (07:50 +0000)]
Upgrade BasicAliasAnalysis::getModRefBehavior to not call Value::getName,
which dynamically allocates the string result. This speeds up dse on the
testcase from PR1432 from 0.3781s to 0.1804s (2.1x).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40838
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Aug 2007 07:32:14 +0000 (07:32 +0000)]
When clearing a SmallPtrSet, if the set had a huge capacity, but the
contents of the set were small, deallocate and shrink the set. This
avoids having us to memset as much data, significantly speeding up
some pathological cases. For example, this speeds up the verifier
from 0.3899s to 0.0763 (5.1x) on the testcase from PR1432 in a
release build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40837
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Aug 2007 00:24:30 +0000 (00:24 +0000)]
Fix an iterator invalidation bug I induced.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40830
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Aug 2007 00:15:57 +0000 (00:15 +0000)]
Switch some std::sets to SmallPtrSet. This speeds up
domtree by 10% and postdomtree by 17%
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40829
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Aug 2007 00:10:08 +0000 (00:10 +0000)]
Switch DomTreeNode::assignDFSNumber from using a std::set to using
a smallptrset. This speeds up domtree by about 15% and postdomtree by 20%.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40828
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Aug 2007 00:02:00 +0000 (00:02 +0000)]
Switch the internal "Info" map from an std::map to a DenseMap. This
speeds up idom by about 45% and postidom by about 33%.
Some extra precautions must be taken not to invalidate densemap iterators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40827
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Aug 2007 23:48:07 +0000 (23:48 +0000)]
switch the DomTreeNodes and IDoms maps in idom/postidom to a
DenseMap instead of an std::map. This speeds up postdomtree
by about 25% and domtree by about 23%. It also speeds up clients,
for example, domfrontier by 11%, mem2reg by 4% and ADCE by 6%.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40826
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Aug 2007 22:50:14 +0000 (22:50 +0000)]
rewrite the code used to construct pruned SSA form with the IDF method.
In the old way, we computed and inserted phi nodes for the whole IDF of
the definitions of the alloca, then computed which ones were dead and
removed them.
In the new method, we first compute the region where the value is live,
and use that information to only insert phi nodes that are live. This
eliminates the need to compute liveness later, and stops the algorithm
from inserting a bunch of phis which it then later removes.
This speeds up the testcase in PR1432 from 2.00s to 0.15s (14x) in a
release build and 6.84s->0.50s (14x) in a debug build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40825
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Aug 2007 21:14:29 +0000 (21:14 +0000)]
Factor out a whole bunch of code into it's own method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40824
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Aug 2007 21:06:15 +0000 (21:06 +0000)]
Use getNumPreds(BB) instead of computing them manually. This is a very small but
measurable speedup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40823
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Aug 2007 20:40:27 +0000 (20:40 +0000)]
Change the rename pass to be "tail recursive", only adding N-1 successors
to the worklist, and handling the last one with a 'tail call'. This speeds
up PR1432 from 2.0578s to 2.0012s (2.8%)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40822
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Aug 2007 20:24:50 +0000 (20:24 +0000)]
cache computation of #preds for a BB. This speeds up
mem2reg from 2.0742->2.0522s on PR1432.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40821
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Aug 2007 20:14:34 +0000 (20:14 +0000)]
reserve operand space for phi nodes when we insert them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40820
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Aug 2007 20:07:06 +0000 (20:07 +0000)]
use continue to avoid nesting, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40819
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Aug 2007 20:03:23 +0000 (20:03 +0000)]
Promoting allocas with the 'single store' fastpath is
faster than with the 'local to a block' fastpath. This speeds
up PR1432 from 2.1232 to 2.0686s (2.6%)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40818
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Aug 2007 20:01:43 +0000 (20:01 +0000)]
When PromoteLocallyUsedAllocas promoted allocas, it didn't remember
to increment NumLocalPromoted, and didn't actually delete the
dead alloca, leading to an extra iteration of mem2reg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40817
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Aug 2007 19:52:20 +0000 (19:52 +0000)]
std::map -> DenseMap
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40816
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Sat, 4 Aug 2007 18:45:32 +0000 (18:45 +0000)]
Clean up comments, fix up some confusing code logic.
Predsimplify fails llvm-gcc bootstrap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40815
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Aug 2007 02:45:02 +0000 (02:45 +0000)]
fix a logic bug where we wouldn't promote single store allocas if the
stored value was a non-instruction value. Doh.
This increase the # single store allocas from 8982 to 9026, and
speeds up mem2reg on the testcase in PR1432 from 2.17 to 2.13s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40813
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Aug 2007 02:38:38 +0000 (02:38 +0000)]
When we do the single-store optimization, delete both the store
and the alloca so they don't get reprocessed.
This speeds up PR1432 from 2.20s to 2.17s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40812
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Aug 2007 02:32:22 +0000 (02:32 +0000)]
Three improvements:
1. Check for revisiting a block before checking domination, which is faster.
2. If the stored value isn't an instruction, we don't have to check for domination.
3. If we have a value used in the same block more than once, make sure to remove the
block from the UsingBlocks vector. Not doing so forces us to go through the slow
path for the alloca.
The combination of these improvements increases the number of allocas on the fastpath
from 8935 to 8982 on PR1432. This speeds it up from 2.90s to 2.20s (31%)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40811
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Aug 2007 02:21:22 +0000 (02:21 +0000)]
switch from using a std::set to using a SmallPtrSet. This speeds up the
testcase in PR1432 from 6.33s to 2.90s (2.22x)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40810
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Aug 2007 02:15:24 +0000 (02:15 +0000)]
In mem2reg, when handling the single-store case, make sure to remove
a using block from the list if we handle it. Not doing this caused us
to not be able to promote (with the fast path) allocas which have uses (whoops).
This increases the # allocas hitting this fastpath from 4042 to 8935 on the
testcase in PR1432, speeding up mem2reg by 2.6x
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40809
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 4 Aug 2007 01:56:21 +0000 (01:56 +0000)]
Regenerating.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40808
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 4 Aug 2007 01:51:18 +0000 (01:51 +0000)]
This is the patch to provide clean intrinsic function overloading support in LLVM. It cleans up the intrinsic definitions and generally smooths the process for more complicated intrinsic writing. It will be used by the upcoming atomic intrinsics as well as vector and float intrinsics in the future.
This also changes the syntax for llvm.bswap, llvm.part.set, llvm.part.select, and llvm.ct* intrinsics. They are automatically upgraded by both the LLVM ASM reader and the bitcode reader. The test cases have been updated, with special tests added to ensure the automatic upgrading is supported.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40807
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Aug 2007 01:47:41 +0000 (01:47 +0000)]
split rewriting of single-store allocas into its own
method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40806
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Aug 2007 01:41:18 +0000 (01:41 +0000)]
refactor some code to shrink PromoteMem2Reg::run a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40805
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Aug 2007 01:19:38 +0000 (01:19 +0000)]
add a typedef, no other change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40804
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Aug 2007 01:07:49 +0000 (01:07 +0000)]
avoid an unneeded vector copy. This speeds up mem2reg on the testcase
in PR1432 by 6%
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40803
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Aug 2007 01:04:40 +0000 (01:04 +0000)]
make RenamePassWorkList a local var instead of an ivar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40802
91177308-0d34-0410-b5e6-
96231b3b80d8
Dale Johannesen [Fri, 3 Aug 2007 22:46:15 +0000 (22:46 +0000)]
Make x86 long double alignment 32 for everything but
Darwin (which makes size within a struct==96)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40796
91177308-0d34-0410-b5e6-
96231b3b80d8
Dale Johannesen [Fri, 3 Aug 2007 20:51:37 +0000 (20:51 +0000)]
long double patch 3 of N. Add to MVT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40793
91177308-0d34-0410-b5e6-
96231b3b80d8
Dale Johannesen [Fri, 3 Aug 2007 20:20:50 +0000 (20:20 +0000)]
long double patch 2 of N. Handle it in TargetData.
(I've tried to get the info right for all targets,
but I'm not expert on all of them - check yours.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40792
91177308-0d34-0410-b5e6-
96231b3b80d8