1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

101 Commits

Author SHA1 Message Date
Owen Anderson
2ebd7e9192 Reuse the reference into the LVI cache throughout the solver subsystem. This is much easier to
verify as being safe thanks its recent de-recursivization.

llvm-svn: 122254
2010-12-20 18:18:16 +00:00
Nick Lewycky
44a08d5812 Make LazyValueInfo non-recursive.
llvm-svn: 122120
2010-12-18 01:00:40 +00:00
Dan Gohman
295ba3ab26 Move Value::getUnderlyingObject to be a standalone
function so that it can live in Analysis instead of
VMCore.

llvm-svn: 121885
2010-12-15 20:02:24 +00:00
Nick Lewycky
44b582fb69 Clean up some of LVI:
* mergeIn now uses constant folding for constants that are provably not-equal.
 * sink some sanity checks from the get*() methods into the mark*() methods, to ensure that we never have a constant/notconstant ConstantInt
 * some textual cleanups, whitespace changes, removing "else" after return, that sort of thing.

llvm-svn: 121877
2010-12-15 18:57:18 +00:00
Owen Anderson
a882a78d4b Take the first step towards making LVI non-recursive: get rid of the LVIQuery abstraction.
llvm-svn: 121357
2010-12-09 06:14:58 +00:00
Owen Anderson
69cbf2e8b7 Now with fewer extraneous semicolons!
llvm-svn: 115996
2010-10-07 22:25:06 +00:00
Owen Anderson
6f3516065f It is possible, under specific circumstances involving ptrtoint ConstantExpr's, for LVI to end up trying to merge
a Constant into a ConstantRange.  Handle this conservatively for now, rather than asserting.  The testcase is
more complex that I would like, but the manifestation of the problem is sensitive to iteration orders and the state of the
LVI cache, and I have not been able to reproduce it with manually constructed or simplified cases.

Fixes PR8162.

llvm-svn: 114103
2010-09-16 18:28:33 +00:00
Owen Anderson
e15120e561 Clean up some of the PassRegistry implementation, and pImpl-ize it to reduce #include clutter
and exposing internal details.

llvm-svn: 113252
2010-09-07 19:16:25 +00:00
Nick Lewycky
9698dae1df Add completely hokey binary-and and binary-or operations to ConstantRange and
teach LazyValueInfo to use them.

llvm-svn: 113196
2010-09-07 05:39:02 +00:00
Chris Lattner
8df3ffd7ac zap dead code.
llvm-svn: 113073
2010-09-04 18:12:00 +00:00
Owen Anderson
9161c79ffe Add support for simplifying a load from a computed value to a load from a global when it
is provable that they're equivalent.  This fixes PR4855.

llvm-svn: 112994
2010-09-03 19:08:37 +00:00
Owen Anderson
1abc937731 Remove incorrect and poorly tested code for trying to reason about values on default edges of
switches.  Just return the conservatively correct answer.

llvm-svn: 112876
2010-09-02 22:16:52 +00:00
Owen Anderson
3206920eb2 Fix a bug in LazyValueInfo that CorrelatedValuePropagation exposed: In the LVI lattice, undef and the full set ConstantRange should not
be treated as equivalent.

llvm-svn: 112843
2010-09-02 18:23:58 +00:00
Owen Anderson
d29fb4b991 It is possible to try to merge a not-constant with a constantrage, when dealing with ptrtoint ConstantExpr's.
Unfortunately, the only testcase I have for this is huge and doesn't reduce well because the error is
sensitive to iteration-order issues, since the problem only occurs when merging values in a particular order.

llvm-svn: 112489
2010-08-30 17:03:45 +00:00
Owen Anderson
f2255ee253 Improve the precision of getConstant().
llvm-svn: 112323
2010-08-27 23:29:38 +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
e0cdfa265a In the default address space, any GEP off of null results in a trap value if you try to load it. Thus,
any load in the default address space that completes implies that the base value that it GEP'd from
was not null.

llvm-svn: 112015
2010-08-25 01:16:47 +00:00
Owen Anderson
5362513cf2 NULL loads are only invalid in the default address space.
llvm-svn: 111972
2010-08-24 22:00:55 +00:00
Owen Anderson
5acb4e1218 Add support for inferring values for the default cases of switches.
llvm-svn: 111971
2010-08-24 21:59:42 +00:00
Owen Anderson
4db6284783 Add support for inferring that a load from a pointer implies that it is not null.
llvm-svn: 111959
2010-08-24 20:47:29 +00:00
Owen Anderson
cb599851f2 Don't assume that all constants with integer types are ConstantInts.
llvm-svn: 111906
2010-08-24 07:55:44 +00:00
Owen Anderson
a57dfdac61 Use ConstantRange to propagate information through value definitions.
llvm-svn: 111425
2010-08-18 21:11:37 +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
Owen Anderson
803f9320fa Fix another iterator invalidation that caused a *really* nasty miscompilation in 403.gcc.
llvm-svn: 111210
2010-08-16 23:42:33 +00:00
Owen Anderson
97ce6f3223 Fix a subtle use-after-free issue.
llvm-svn: 110863
2010-08-11 22:36:04 +00:00
Owen Anderson
0692635e68 Improve indentation.
llvm-svn: 110778
2010-08-11 04:24:25 +00:00
Owen Anderson
a095d3fe73 Now that we're using ConstantRange to represent potential values, make use of that represenation to
create constraints from comparisons other than eq/neq.

llvm-svn: 110742
2010-08-10 23:20:01 +00:00
Owen Anderson
a3a2b79f01 Switch over to using ConstantRange to track integral values.
llvm-svn: 110714
2010-08-10 20:03:09 +00:00
Owen Anderson
cdd7cdc49a Add ConstantRange information to the debugging output.
llvm-svn: 110598
2010-08-09 20:50:46 +00:00
Owen Anderson
86690fa988 Add the beginnings of infrastructure for range tracking.
llvm-svn: 110388
2010-08-05 22:59:19 +00:00
Owen Anderson
68ee87e057 Split the tag and value members of LVILatticeVal in preparation for expanding the lattice to something that won't fit in two bits.
llvm-svn: 110383
2010-08-05 22:10:46 +00:00
Owen Anderson
e1aed29cca Add an initial implementation of PHI translation for LazyValueInfo. This involves rolling back some
of my earlier data structure improvements until I can ensure that there are no iterator invalidation problems.

llvm-svn: 109935
2010-07-30 23:59:40 +00:00
Owen Anderson
4e6f48d705 Revert my last two patches to LVI, which recent changes have exposed a miscompilation in.
llvm-svn: 109889
2010-07-30 20:56:07 +00:00
Owen Anderson
712152a68e Pass the queried value by argument rather than in a member, in preparation for supporting PHI translation.
llvm-svn: 109701
2010-07-28 23:50:08 +00:00
Owen Anderson
670fd343a5 Get rid of LVIQuery as a distinct data structure, so that we don't have to initialize a new set of maps on every query.
llvm-svn: 109679
2010-07-28 22:07:25 +00:00
Owen Anderson
2d39891e91 Rearrange several datastructures in LazyValueInfo to improve compile time.
This is still not perfect, but better than it was before.

llvm-svn: 109563
2010-07-27 23:58:11 +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
David Greene
016e0af68d Convert debug messages to use dbgs(). Generally this means
s/errs/dbgs/g except for certain special cases.

llvm-svn: 92040
2009-12-23 20:43:58 +00:00
Chris Lattner
f3d89dee33 typo spotted by duncan.
llvm-svn: 88884
2009-11-16 03:51:42 +00:00
Chris Lattner
34aefed024 teach LVI to infer edge information from switch instructions.
This allows JT to eliminate a ton of infeasible edges when
handling code like the templates in PatternMatch.h

llvm-svn: 88869
2009-11-15 20:02:12 +00:00
Chris Lattner
69a52dd583 fix a logic error that would cause LVI-JT to miscompile
some conditionals

llvm-svn: 88868
2009-11-15 20:01:24 +00:00
Chris Lattner
7ea8b3fbf8 implement the first stab at caching queries. This isn't correct
(because the invalidation logic is missing) but LVI isn't enabled
by default anyway.

llvm-svn: 88867
2009-11-15 20:00:52 +00:00
Chris Lattner
b9a9336376 refactor a bunch of code forming the new LazyValueInfoCache
and LVIQuery classes, no functionality change.

llvm-svn: 88866
2009-11-15 19:59:49 +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
6d1ca5d976 Add a new getPredicateOnEdge method which returns more rich information for
constant constraints.  Improve the LVI lattice to include inequality 
constraints.

llvm-svn: 86950
2009-11-12 04:36:58 +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
46056d81aa move some stuff into DEBUG's and turn on lazy-value-info for
the basic.ll testcase.

llvm-svn: 86918
2009-11-12 01:22:16 +00:00
Chris Lattner
4c831006c7 make LazyValueInfo actually to some stuff. This isn't very tested but improves
strswitch.

llvm-svn: 86889
2009-11-11 22:48:44 +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
6c04051d2a Stub out a new lazy value info pass, which will eventually
vend value constraint information to the optimizer.

llvm-svn: 86767
2009-11-11 00:22:30 +00:00