Commit Graph

3444 Commits

Author SHA1 Message Date
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
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
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
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
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
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
f12f8def39 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
2007-08-04 22:50:14 +00:00
Chris Lattner
0ec8df3d5f 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
2007-08-04 21:14:29 +00:00
Chris Lattner
127ed3c929 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
2007-08-04 21:06:15 +00:00
Chris Lattner
1e76af3011 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
2007-08-04 20:40:27 +00:00
Chris Lattner
e7b653dabe 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
2007-08-04 20:24:50 +00:00
Chris Lattner
384c7e0436 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
2007-08-04 20:14:34 +00:00
Chris Lattner
6c81213b4c 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
2007-08-04 20:07:06 +00:00
Chris Lattner
fb312c7e44 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
2007-08-04 20:03:23 +00:00
Chris Lattner
7a5745b38c 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
2007-08-04 20:01:43 +00:00
Chris Lattner
59a2837715 std::map -> DenseMap
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40816 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-04 19:52:20 +00:00
Nick Lewycky
7956dae870 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
2007-08-04 18:45:32 +00:00
Chris Lattner
c69e491575 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
2007-08-04 02:45:02 +00:00
Chris Lattner
4f63e76cda 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
2007-08-04 02:38:38 +00:00
Chris Lattner
d0458e5d4f 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
2007-08-04 02:32:22 +00:00
Chris Lattner
c3f6ea8330 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
2007-08-04 02:21:22 +00:00
Chris Lattner
b776a335b1 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
2007-08-04 02:15:24 +00:00
Chandler Carruth
6994040a95 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
2007-08-04 01:51:18 +00:00
Chris Lattner
5dd75b4ca7 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
2007-08-04 01:47:41 +00:00
Chris Lattner
bbe104002f 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
2007-08-04 01:41:18 +00:00
Chris Lattner
483ce14bf4 add a typedef, no other change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40804 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-04 01:19:38 +00:00
Chris Lattner
63cdcaa3d6 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
2007-08-04 01:07:49 +00:00
Chris Lattner
ac4aa4be9b 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
2007-08-04 01:04:40 +00:00
Owen Anderson
ab8702787d Fix a subtle miscompilation. This allows 197.parser to be compiled correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40791 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03 19:59:35 +00:00
Owen Anderson
4b55c3b0f1 Fix a subtle iterator invalidation bug in a recursive algorithm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40776 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03 11:03:26 +00:00
Chris Lattner
b0e71edb6b Fix an accidental commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40758 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 21:33:36 +00:00
Owen Anderson
9fed589912 Fix 80 col. violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40751 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 18:20:52 +00:00
Owen Anderson
830db6a00e Fix 80 col. violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40750 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 18:16:06 +00:00
Owen Anderson
666f6fe0ce Fix 80 col. violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40749 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 18:11:11 +00:00
Owen Anderson
1c2763d3fe Fix a bug that was causing several miscompilations on SPEC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40746 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 17:56:05 +00:00
Chris Lattner
5543a856ff Replacing a cast with another one does not reduce the number of
casts in the input.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40741 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 17:23:38 +00:00
Chris Lattner
b014678eb3 Disable an xform that causes an infinite loop. This fixes PR1594
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40739 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 16:56:32 +00:00
Chris Lattner
684b22df79 wrap some long lines. Major offenders that are left include
gvn, gvnpre, dse, and predsimplify.  To see these, use:

  make check-line-length



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40738 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 16:53:43 +00:00
Devang Patel
1ff61385c8 Update dominator info for the middle blocks created while spliting
exit edge to preserve LCSSA.

Fix dominance frontier update during loop unswitch. This fixes PR 1589, again



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40737 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 15:25:57 +00:00
Chris Lattner
951626b437 Enhance instcombine to be more aggressive about folding casts of
operations of casts.  This implements InstCombine/zext-fold.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40726 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 06:11:14 +00:00
Chris Lattner
9dd7a5178f Fix PR1575 and test/Transforms/CondProp/2007-08-01-InvalidRead.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40720 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 04:47:05 +00:00
Devang Patel
2f2e519083 Undo previous check-in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40698 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 23:24:50 +00:00
Devang Patel
28ae151c48 Update dominator info for the middle blocks created while spliting
exit edge to preserve LCSSA.

Fix dominance frontier update during loop unswitch. This fixes PR 1589.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40695 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 22:23:50 +00:00
Owen Anderson
9066020993 Make non-local memdep not be recursive, and fix a bug on 403.gcc that this exposed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40692 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 22:01:54 +00:00
Dan Gohman
c2bbfc18e9 More explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40673 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 15:32:29 +00:00
Owen Anderson
f6a05f949f Rename FastDSE to just DSE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40668 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 06:36:51 +00:00
Owen Anderson
a56c34f90b Move FastDSE in to DeadStoreElimination.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40667 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 06:30:51 +00:00
Owen Anderson
e739bae8da Remove old DSE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40666 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 06:30:10 +00:00