Owen Anderson
af33f22b40
Re-apply r112539, being more careful to respect the return values of the constant folding methods. Additionally,
...
use the ConstantExpr::get*() methods to simplify some constant folding.
llvm-svn: 112550
2010-08-30 23:22:36 +00:00
Owen Anderson
9d301e20e8
Revert r112539. It accidentally introduced a miscompilation.
...
llvm-svn: 112543
2010-08-30 22:33:41 +00:00
Owen Anderson
479c0c406f
Fixes and cleanups pointed out by Chris. In general, be careful to handle 0 results from ComputeValueKnownInPredecessors
...
(indicating undef), and re-use existing constant folding APIs.
llvm-svn: 112539
2010-08-30 22:07:52 +00:00
Owen Anderson
a1a80a3acd
Fix typos in comments.
...
llvm-svn: 112286
2010-08-27 20:32:56 +00:00
Owen Anderson
35ff7a208e
Use LVI to eliminate conditional branches where we've tested a related condition previously. Update tests for this change.
...
This fixes PR5652.
llvm-svn: 112270
2010-08-27 17:12:29 +00:00
Owen Anderson
77fcf53657
Make JumpThreading smart enough to properly thread StrSwitch when it's compiled with clang++.
...
llvm-svn: 112198
2010-08-26 17:40:24 +00:00
Owen Anderson
a4d73e6be9
Turn LVI on, previously detected failures should be fixed now.
...
llvm-svn: 111923
2010-08-24 17:21:18 +00:00
Owen Anderson
9f7621fa94
Turn LVI back off, I have a testcase now.
...
llvm-svn: 111834
2010-08-23 19:59:27 +00:00
Owen Anderson
ee69c0112d
Re-enable LazyValueInfo. Monitoring for failures.
...
llvm-svn: 111816
2010-08-23 18:12:23 +00:00
Owen Anderson
e22f313e44
Disable LVI while I evaluate a failure.
...
llvm-svn: 111551
2010-08-19 19:47:08 +00:00
Owen Anderson
9de85fb6c0
Tentatively enabled LVI by default. I'll be monitoring for any failures.
...
llvm-svn: 111543
2010-08-19 19:04:40 +00:00
Owen Anderson
65795241db
Inform LazyValueInfo whenever a block is deleted, to avoid dangling pointer issues.
...
llvm-svn: 111382
2010-08-18 18:39:01 +00:00
Chris Lattner
ab876b6ce8
Fix PR7755: knowing something about an inval for a pred
...
from the LHS should disable reconsidering that pred on the
RHS. However, knowing something about the pred on the RHS
shouldn't disable subsequent additions on the RHS from
happening.
llvm-svn: 111349
2010-08-18 03:14:36 +00:00
Owen Anderson
f2fea95f2f
Reapply r110396, with fixes to appease the Linux buildbot gods.
...
llvm-svn: 110460
2010-08-06 18:33:48 +00:00
Owen Anderson
aadd8a89ca
Revert r110396 to fix buildbots.
...
llvm-svn: 110410
2010-08-06 00:23:35 +00:00
Owen Anderson
b9762c07cb
Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
...
ID member as the sole unique type identifier. Clean up APIs related to this change.
llvm-svn: 110396
2010-08-05 23:42:04 +00:00
Owen Anderson
bbeb4e2e58
Give JumpThreading+LVI a long-form cl::opt so that it's easier to toggle the default.
...
llvm-svn: 110384
2010-08-05 22:11:31 +00:00
Owen Anderson
12ab6162bf
Add an initial implementation of LazyValueInfo updating for JumpThreading. Disabled for now.
...
llvm-svn: 109424
2010-07-26 18:48:03 +00:00
Owen Anderson
f8addbb0a1
Fix batch of converting RegisterPass<> to INTIALIZE_PASS().
...
llvm-svn: 109045
2010-07-21 22:09:45 +00:00
Gabor Greif
8159329bfb
cache results of operator*
...
llvm-svn: 108142
2010-07-12 14:10:24 +00:00
Chris Lattner
baef771d17
if jump threading is able to infer interesting values on both
...
the LHS and RHS of an and/or instruction, don't multiply add
known predecessor values. This fixes the crash on testcase
from PR7498
llvm-svn: 108114
2010-07-12 00:47:34 +00:00
Chris Lattner
88d51b0f4c
jump threading can't split a critical edge from an indirectbr. This
...
fixes PR7356.
llvm-svn: 105950
2010-06-14 19:45:43 +00:00
Dan Gohman
0d7d3faf8e
Move FindAvailableLoadedValue isSafeToLoadUnconditionally out of
...
lib/Transforms/Utils and into lib/Analysis so that Analysis passes
can use them.
llvm-svn: 104949
2010-05-28 16:19:17 +00:00
Chris Lattner
92b4e858d0
fix PR6743, a case where we'd delete an instruction before using it
...
in some cases.
llvm-svn: 100937
2010-04-10 18:26:57 +00:00
Duncan Sands
1b33dd3c83
There are two ways of checking for a given type, for example isa<PointerType>(T)
...
and T->isPointerTy(). Convert most instances of the first form to the second form.
Requested by Chris.
llvm-svn: 96344
2010-02-16 11:11:14 +00:00
Duncan Sands
2acaf3609c
Uniformize the names of type predicates: rather than having isFloatTy and
...
isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris!
llvm-svn: 96223
2010-02-15 16:12:20 +00:00
Chris Lattner
733ffcdb1f
Make jump threading honor x|undef -> true and x&undef -> false,
...
instead of considering x|undef -> x, which may not be true.
llvm-svn: 95850
2010-02-11 04:40:44 +00:00
Chris Lattner
b444bc0234
third bug from PR6119: the xor dupe extension allows
...
for arbitrary terminators in predecessors, don't assume
it is a conditional or uncond branch. The testcase shows
an example where they can happen with switches.
llvm-svn: 94323
2010-01-23 19:21:31 +00:00
Chris Lattner
7130788ea2
add an early out to ProcessBranchOnXOR to speed it up,
...
handle the case when we can infer an input to the xor
from all inputs that agree, instead of going into an
infinite loop. Another part of PR6199
llvm-svn: 94321
2010-01-23 19:16:25 +00:00
Chris Lattner
e4391a1adb
fix a crash in jump threading, PR6119
...
llvm-svn: 94319
2010-01-23 18:56:07 +00:00
Chris Lattner
21bbaf49d5
1) Use the new SimplifyInstructionsInBlock routine instead of the copy
...
in JT.
2) When cloning blocks for PHI or xor conditions, use
instsimplify to simplify the code as we go. This allows us to
squish common cases early in JT which opens up opportunities for
subsequent iterations, and allows it to completely simplify the
testcase.
llvm-svn: 93253
2010-01-12 20:41:47 +00:00
Chris Lattner
bc0016437d
tidy up
...
llvm-svn: 93222
2010-01-12 02:07:50 +00:00
Chris Lattner
774e3967ad
Teach jump threading to duplicate small blocks when the branch
...
condition is a xor with a phi node. This eliminates nonsense
like this from 176.gcc in several places:
LBB166_84:
testl %eax, %eax
- setne %al
- xorb %cl, %al
- notb %al
- testb $1, %al
- je LBB166_85
+ je LBB166_69
+ jmp LBB166_85
This is rdar://7391699
llvm-svn: 93221
2010-01-12 02:07:17 +00:00
Chris Lattner
d6d8cc7b37
some cleanup, and make it obvious that ProcessJumpOnPHI only works
...
on branches by renaming it and checking for a branch at the call site.
llvm-svn: 93208
2010-01-11 23:41:09 +00:00
Benjamin Kramer
df696ee6b4
Use a do-while loop instead of while + boolean.
...
llvm-svn: 92912
2010-01-07 13:50:07 +00:00
David Greene
0a35321dc2
Change errs() to dbgs().
...
llvm-svn: 92614
2010-01-05 01:27:19 +00:00
Chris Lattner
6dd4686b48
Metadata.h doesn't need to include ValueHandle.h anymore.
...
llvm-svn: 92211
2009-12-28 08:20:46 +00:00
Chris Lattner
7066a138ff
fix PR5698
...
llvm-svn: 90708
2009-12-06 17:17:23 +00:00
Chris Lattner
7c0c90df97
fix PR5640 by tracking whether a block is the header of a loop more
...
precisely, which prevents us from infinitely peeling the loop.
llvm-svn: 90211
2009-12-01 06:04:43 +00:00
Chris Lattner
15cd19dddb
make PRE of loads preserve the alignment of the moved load instruction.
...
llvm-svn: 88865
2009-11-15 19:58:31 +00:00
Chris Lattner
59f69de88f
fix a bug handling 'not x' when x is undef.
...
llvm-svn: 88864
2009-11-15 19:57:43 +00:00
Chris Lattner
01fddcec53
use getPredicateOnEdge to fold comparisons through PHI nodes,
...
which implements GCC PR18046. This also gets us 360 more
jump threads on 176.gcc.
llvm-svn: 86953
2009-11-12 05:24:05 +00:00
Chris Lattner
3e63fb7318
various fixes to the lattice transfer functions.
...
llvm-svn: 86952
2009-11-12 04:57:13 +00:00
Chris Lattner
c1619b4fe9
switch jump threading to use getPredicateOnEdge in one place
...
making the new LVI stuff smart enough to subsume some special
cases in the old code. Disable them when LVI is around, the
testcase still passes.
llvm-svn: 86951
2009-11-12 04:37:50 +00:00
Chris Lattner
68f3b53ddc
with the new code we can thread non-instruction values. This
...
allows us to handle the test10 testcase.
llvm-svn: 86924
2009-11-12 01:41:34 +00:00
Chris Lattner
ea8b237a74
this argument can be an arbitrary value, it doesn't need to be an instruction.
...
llvm-svn: 86923
2009-11-12 01:37:43 +00:00
Chris Lattner
b5bb115ece
expose edge information and switch j-t to use it.
...
llvm-svn: 86920
2009-11-12 01:29:10 +00:00
Chris Lattner
73b7ed2d9c
pass TD into a SimplifyCmpInst call. Add another case that
...
uses LVI info when -enable-jump-threading-lvi is passed.
llvm-svn: 86886
2009-11-11 22:31:38 +00:00
Chris Lattner
b45381c3f0
stub out some LazyValueInfo interfaces, and have JumpThreading
...
start using them in a trivial way when -enable-jump-threading-lvi
is passed. enable-jump-threading-lvi will be my playground for
awhile.
llvm-svn: 86789
2009-11-11 02:08:33 +00:00
Chris Lattner
c1709a798a
add a fixme
...
llvm-svn: 86766
2009-11-11 00:21:58 +00:00