Devang Patel
08504a95b0
Fix new compare instruction's signness. Caught by Chris during review.
...
llvm-svn: 40912
2007-08-07 23:17:52 +00:00
Owen Anderson
2c98f8ee3c
Don't insert nearly as many redundant phi nodes.
...
llvm-svn: 40909
2007-08-07 23:12:31 +00:00
Devang Patel
92d6834fd7
Use eraseFromParent().
...
llvm-svn: 40903
2007-08-07 17:45:35 +00:00
David Greene
310b0d7e39
Fix comment typo
...
llvm-svn: 40898
2007-08-07 16:52:03 +00:00
David Greene
7eea029403
Fix GLIBCXX_DEBUG error triggered by incrementing erased iterator.
...
llvm-svn: 40897
2007-08-07 16:44:38 +00:00
Devang Patel
228dc09ff6
Begin loop index split pass.
...
llvm-svn: 40883
2007-08-07 00:25:56 +00:00
Nick Lewycky
34cf98c558
It's safe to fold not of fcmp.
...
llvm-svn: 40870
2007-08-06 20:04:16 +00:00
David Greene
02ac5cfce9
Make this code more efficient.
...
llvm-svn: 40861
2007-08-06 15:09:17 +00:00
Chris Lattner
bf64e878e6
remove some dead lines
...
llvm-svn: 40859
2007-08-06 06:21:06 +00:00
Reid Spencer
ac9262072f
Silence some warnings from doxygen about @param argument name not matching the
...
actual argument name of the documented function.
llvm-svn: 40851
2007-08-05 19:35:22 +00:00
Chris Lattner
6d8e77a703
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%)
llvm-svn: 40840
2007-08-05 08:47:58 +00:00
Chris Lattner
e562e9bdb0
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.
llvm-svn: 40825
2007-08-04 22:50:14 +00:00
Chris Lattner
b7d4ef6ca6
Factor out a whole bunch of code into it's own method.
...
llvm-svn: 40824
2007-08-04 21:14:29 +00:00
Chris Lattner
d4a88d77d4
Use getNumPreds(BB) instead of computing them manually. This is a very small but
...
measurable speedup.
llvm-svn: 40823
2007-08-04 21:06:15 +00:00
Chris Lattner
6b9dca62dd
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%)
llvm-svn: 40822
2007-08-04 20:40:27 +00:00
Chris Lattner
c1d2c2bdc8
cache computation of #preds for a BB. This speeds up
...
mem2reg from 2.0742->2.0522s on PR1432.
llvm-svn: 40821
2007-08-04 20:24:50 +00:00
Chris Lattner
8335a86536
reserve operand space for phi nodes when we insert them.
...
llvm-svn: 40820
2007-08-04 20:14:34 +00:00
Chris Lattner
32d9e4ba5c
use continue to avoid nesting, no functionality change.
...
llvm-svn: 40819
2007-08-04 20:07:06 +00:00
Chris Lattner
a97ceae263
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%)
llvm-svn: 40818
2007-08-04 20:03:23 +00:00
Chris Lattner
479e3fa267
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.
llvm-svn: 40817
2007-08-04 20:01:43 +00:00
Chris Lattner
bd506a8e12
std::map -> DenseMap
...
llvm-svn: 40816
2007-08-04 19:52:20 +00:00
Nick Lewycky
4e96222245
Clean up comments, fix up some confusing code logic.
...
Predsimplify fails llvm-gcc bootstrap.
llvm-svn: 40815
2007-08-04 18:45:32 +00:00
Chris Lattner
9748fa5c6f
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.
llvm-svn: 40813
2007-08-04 02:45:02 +00:00
Chris Lattner
3f971fdbd5
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.
llvm-svn: 40812
2007-08-04 02:38:38 +00:00
Chris Lattner
c38b2a2473
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%)
llvm-svn: 40811
2007-08-04 02:32:22 +00:00
Chris Lattner
fe6a3e2fb4
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)
llvm-svn: 40810
2007-08-04 02:21:22 +00:00
Chris Lattner
9b45ad1f5c
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
llvm-svn: 40809
2007-08-04 02:15:24 +00:00
Chandler Carruth
00e56b0e81
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.
llvm-svn: 40807
2007-08-04 01:51:18 +00:00
Chris Lattner
b5af2cf90d
split rewriting of single-store allocas into its own
...
method.
llvm-svn: 40806
2007-08-04 01:47:41 +00:00
Chris Lattner
f8b22a3568
refactor some code to shrink PromoteMem2Reg::run a bit
...
llvm-svn: 40805
2007-08-04 01:41:18 +00:00
Chris Lattner
2d4d557c80
add a typedef, no other change.
...
llvm-svn: 40804
2007-08-04 01:19:38 +00:00
Chris Lattner
65181deba3
avoid an unneeded vector copy. This speeds up mem2reg on the testcase
...
in PR1432 by 6%
llvm-svn: 40803
2007-08-04 01:07:49 +00:00
Chris Lattner
34cf111957
make RenamePassWorkList a local var instead of an ivar.
...
llvm-svn: 40802
2007-08-04 01:04:40 +00:00
Owen Anderson
891f5b4d28
Fix a subtle miscompilation. This allows 197.parser to be compiled correctly.
...
llvm-svn: 40791
2007-08-03 19:59:35 +00:00
Owen Anderson
d1063b7a3c
Fix a subtle iterator invalidation bug in a recursive algorithm.
...
llvm-svn: 40776
2007-08-03 11:03:26 +00:00
Chris Lattner
cf6dd53ad8
Fix an accidental commit.
...
llvm-svn: 40758
2007-08-02 21:33:36 +00:00
Owen Anderson
414247c075
Fix 80 col. violations.
...
llvm-svn: 40751
2007-08-02 18:20:52 +00:00
Owen Anderson
ad74eeed3d
Fix 80 col. violations.
...
llvm-svn: 40750
2007-08-02 18:16:06 +00:00
Owen Anderson
ae769ac824
Fix 80 col. violations.
...
llvm-svn: 40749
2007-08-02 18:11:11 +00:00
Owen Anderson
d617e4c963
Fix a bug that was causing several miscompilations on SPEC.
...
llvm-svn: 40746
2007-08-02 17:56:05 +00:00
Chris Lattner
5ca7348fc4
Replacing a cast with another one does not reduce the number of
...
casts in the input.
llvm-svn: 40741
2007-08-02 17:23:38 +00:00
Chris Lattner
7c6e8f735f
Disable an xform that causes an infinite loop. This fixes PR1594
...
llvm-svn: 40739
2007-08-02 16:56:32 +00:00
Chris Lattner
25a8bfdedb
wrap some long lines. Major offenders that are left include
...
gvn, gvnpre, dse, and predsimplify. To see these, use:
make check-line-length
llvm-svn: 40738
2007-08-02 16:53:43 +00:00
Devang Patel
937b07fb5e
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
llvm-svn: 40737
2007-08-02 15:25:57 +00:00
Chris Lattner
0111f62050
Enhance instcombine to be more aggressive about folding casts of
...
operations of casts. This implements InstCombine/zext-fold.ll
llvm-svn: 40726
2007-08-02 06:11:14 +00:00
Chris Lattner
2cacb6cc56
Fix PR1575 and test/Transforms/CondProp/2007-08-01-InvalidRead.ll
...
llvm-svn: 40720
2007-08-02 04:47:05 +00:00
Devang Patel
f21f509c2c
Undo previous check-in.
...
llvm-svn: 40698
2007-08-01 23:24:50 +00:00
Devang Patel
51c61e730a
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.
llvm-svn: 40695
2007-08-01 22:23:50 +00:00
Owen Anderson
7028dfaf9d
Make non-local memdep not be recursive, and fix a bug on 403.gcc that this exposed.
...
llvm-svn: 40692
2007-08-01 22:01:54 +00:00
Dan Gohman
7dd04fb91c
More explicit keywords.
...
llvm-svn: 40673
2007-08-01 15:32:29 +00:00