Commit Graph

19777 Commits

Author SHA1 Message Date
Chris Lattner
de0e42d3c0 Speed up updateDFSNumbers with two observations:
1. domtree is a tree, not a graph.  There is no need to avoid revisiting nodes with a set.
2. the worklist can contain the child iterator pointers so we don't get N^2 rescanning of children.

This speeds up updateDFSNumbers significantly, making it basically free.  On the testcase in PR1432,
this speeds up loopsimplify by another 3x, dropping it from the 12th most expensive pass to the to
the 30th. :)  It used to be #1.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40923 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 06:24:20 +00:00
Owen Anderson
c182f17aed A few more small cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40922 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 06:06:02 +00:00
Evan Cheng
a141cfe5b2 Clean up and bug fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40921 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 05:56:18 +00:00
Chris Lattner
3e089ae0b8 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
2007-08-08 05:51:24 +00:00
Owen Anderson
6ca4cb3755 First round of cleanups from Chris' feedback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40919 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 04:52:29 +00:00
Evan Cheng
8df786012d - 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
2007-08-08 03:00:28 +00:00
Devang Patel
6a2bfdaab6 Embrace patch review feedback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40915 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 01:51:27 +00:00
Evan Cheng
51cbf3c980 Remove a dead assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40914 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 01:00:21 +00:00
Evan Cheng
a8d94f1315 - 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
2007-08-07 23:49:57 +00:00
Devang Patel
002fe25dd7 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
2007-08-07 23:17:52 +00:00
Owen Anderson
a37226af81 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
2007-08-07 23:12:31 +00:00
Dale Johannesen
84109cd015 Fix spelling of mtvscr and mfvscr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40908 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-07 23:08:00 +00:00
Dale Johannesen
cdbe4d3ebe 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
2007-08-07 20:29:26 +00:00
Devang Patel
8431a1cbcc Use eraseFromParent().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40903 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-07 17:45:35 +00:00
David Greene
32fe3de0fe Fix comment typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40898 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-07 16:52:03 +00:00
David Greene
8ff18e9c99 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
2007-08-07 16:44:38 +00:00
David Greene
7e23146ab9 Add a missing forward declaration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40896 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-07 16:34:05 +00:00
Evan Cheng
0ff94f7fcc 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
2007-08-07 01:37:15 +00:00
Dale Johannesen
a996d52e37 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
2007-08-07 01:17:37 +00:00
Owen Anderson
dbbe816757 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
2007-08-07 00:33:45 +00:00
Devang Patel
fee76bd9ba Begin loop index split pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40883 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-07 00:25:56 +00:00
Owen Anderson
8f35315798 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
2007-08-06 23:26:03 +00:00
Dale Johannesen
9989a65693 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
2007-08-06 22:10:35 +00:00
Dale Johannesen
27f92be8b7 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
2007-08-06 21:48:35 +00:00
Dale Johannesen
6a30811d5c 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
2007-08-06 21:31:06 +00:00
Chris Lattner
0275cffa97 regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40875 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-06 21:00:46 +00:00
Chris Lattner
6df20efcc3 Fix PR1577, a crash on invalid bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40874 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-06 21:00:37 +00:00
Chandler Carruth
a583990ec8 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
2007-08-06 20:57:16 +00:00
Nick Lewycky
f947b3edb5 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
2007-08-06 20:04:16 +00:00
Dale Johannesen
88835735f4 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
2007-08-06 19:50:32 +00:00
Nick Lewycky
d6dac0eebc 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
2007-08-06 19:21:00 +00:00
Nick Lewycky
06323bfe03 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
2007-08-06 18:33:46 +00:00
Chris Lattner
914ce4508d 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
2007-08-06 16:36:18 +00:00
Christopher Lamb
98363225a3 Implement review feedback. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40863 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-06 16:33:56 +00:00
David Greene
242be6e0ff Make this code more efficient.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40861 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-06 15:09:17 +00:00
Chris Lattner
3589df8013 remove some dead lines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40859 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-06 06:21:06 +00:00
Chris Lattner
7ed54a0ece 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
2007-08-06 06:19:47 +00:00
Reid Spencer
181b6c9cb5 Fix minor doxygen nits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40854 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-05 20:06:04 +00:00
Reid Spencer
81a7572f1a 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
2007-08-05 19:35:22 +00:00
Reid Spencer
c69b0dd19d Escape some escapes that confuse doxygen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40850 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-05 19:33:11 +00:00
Reid Spencer
daa10a46b2 Fix a doxygen directive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40849 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-05 19:27:01 +00:00
Dale Johannesen
59a587337e 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
2007-08-05 18:49:15 +00:00
Chris Lattner
e76fad2ceb shorten this name
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40843 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-05 18:45:33 +00:00
Chris Lattner
a9ff5eb76e 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
2007-08-05 08:47:58 +00:00
Chris Lattner
8c5287086c 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
2007-08-05 07:50:06 +00:00
Chris Lattner
42e4bdf257 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
2007-08-05 07:32:14 +00:00
Chris Lattner
a31965301d Fix an iterator invalidation bug I induced.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40830 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-05 00:24:30 +00:00
Chris Lattner
2f0d1ea864 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
2007-08-05 00:15:57 +00:00
Chris Lattner
7ae8c4c810 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
2007-08-05 00:10:08 +00:00
Chris Lattner
e93e311981 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
2007-08-05 00:02:00 +00:00