aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/LazyValueInfo.cpp
AgeCommit message (Collapse)AuthorFilesLines
2011-07-18land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner1-3/+3
llvm-svn: 135375
2011-05-31llvm.memcpy.* has two distinct associated address spaces; the source address ↵Eli Friedman1-4/+6
space, and the destination address space. Fix up the interface on MemIntrinsic and MemTransferInst to make this clear, and fix InstructionDereferencesPointer in LazyValueInfo.cpp to use the interface properly. llvm-svn: 132356
2011-04-23Remove unused STL header includes.Jay Foad1-1/+0
llvm-svn: 130068
2011-04-18Mark some functions as used which are used within debug-only code. ThisChandler Carruth1-0/+2
silences Clang's -Wunused-function when building in release mode. llvm-svn: 129709
2011-01-15Teach LazyValueInfo that allocas aren't NULL. Over all of llvm-test, this savesNick Lewycky1-5/+27
half a million non-local queries, each of which would otherwise have triggered a linear scan over a basic block. Also fix a fixme for memory intrinsics which dereference pointers. With this, we prove that a pointer is non-null because it was dereferenced by an intrinsic 112 times in llvm-test. llvm-svn: 123533
2011-01-05Reorder, rename, and document some members to make this easier to follow.Owen Anderson1-20/+23
llvm-svn: 122929
2011-01-05When computing the value on an edge, in certain cases LVI would fail to ↵Owen Anderson1-0/+5
compute the value range in the predecessor block, leading to an incorrect conclusion for the edge value. Found by inspection. llvm-svn: 122908
2011-01-05Re-convert several of LazyValueInfo's internal maps to Dense{Map|Set}, and ↵Owen Anderson1-33/+93
fix the issue in hasBlockValue() that was causing iterator invalidations. Many thanks to Dimitry Andric for tracking down those invalidations! llvm-svn: 122906
2010-12-20Speculatively revert the use of DenseMap in LazyValueInfo, which may be ↵Owen Anderson1-42/+16
causing Linux self-host failures. llvm-svn: 122291
2010-12-20Attempt to appease the DragonEgg buildbots.Owen Anderson1-22/+24
llvm-svn: 122288
2010-12-20Convert one of LVI's primary maps to a DenseMap, now that we know are more ↵Owen Anderson1-16/+40
assured of iterator stability. llvm-svn: 122273
2010-12-20More LVI cleanups, including trying to simplify the process of maintaining ↵Owen Anderson1-25/+41
the OverDefinedCache. llvm-svn: 122256
2010-12-20Reuse the reference into the LVI cache throughout the solver subsystem. ↵Owen Anderson1-24/+28
This is much easier to verify as being safe thanks its recent de-recursivization. llvm-svn: 122254
2010-12-18Make LazyValueInfo non-recursive.Nick Lewycky1-132/+249
llvm-svn: 122120
2010-12-15Move Value::getUnderlyingObject to be a standaloneDan Gohman1-2/+3
function so that it can live in Analysis instead of VMCore. llvm-svn: 121885
2010-12-15Clean up some of LVI:Nick Lewycky1-91/+101
* 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-09Take the first step towards making LVI non-recursive: get rid of the ↵Owen Anderson1-101/+39
LVIQuery abstraction. llvm-svn: 121357
2010-10-07Now with fewer extraneous semicolons!Owen Anderson1-1/+1
llvm-svn: 115996
2010-09-16It is possible, under specific circumstances involving ptrtoint ↵Owen Anderson1-3/+7
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-07Clean up some of the PassRegistry implementation, and pImpl-ize it to reduce ↵Owen Anderson1-0/+2
#include clutter and exposing internal details. llvm-svn: 113252
2010-09-07Add completely hokey binary-and and binary-or operations to ConstantRange andNick Lewycky1-0/+6
teach LazyValueInfo to use them. llvm-svn: 113196
2010-09-04zap dead code.Chris Lattner1-4/+0
llvm-svn: 113073
2010-09-03Add support for simplifying a load from a computed value to a load from a ↵Owen Anderson1-2/+11
global when it is provable that they're equivalent. This fixes PR4855. llvm-svn: 112994
2010-09-02Remove incorrect and poorly tested code for trying to reason about values on ↵Owen Anderson1-16/+2
default edges of switches. Just return the conservatively correct answer. llvm-svn: 112876
2010-09-02Fix a bug in LazyValueInfo that CorrelatedValuePropagation exposed: In the ↵Owen Anderson1-4/+0
LVI lattice, undef and the full set ConstantRange should not be treated as equivalent. llvm-svn: 112843
2010-08-30It is possible to try to merge a not-constant with a constantrage, when ↵Owen Anderson1-2/+3
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-27Improve the precision of getConstant().Owen Anderson1-0/+5
llvm-svn: 112323
2010-08-27Use LVI to eliminate conditional branches where we've tested a related ↵Owen Anderson1-1/+2
condition previously. Update tests for this change. This fixes PR5652. llvm-svn: 112270
2010-08-25In the default address space, any GEP off of null results in a trap value if ↵Owen Anderson1-4/+5
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-24NULL loads are only invalid in the default address space.Owen Anderson1-1/+1
llvm-svn: 111972
2010-08-24Add support for inferring values for the default cases of switches.Owen Anderson1-3/+22
llvm-svn: 111971
2010-08-24Add support for inferring that a load from a pointer implies that it is not ↵Owen Anderson1-4/+17
null. llvm-svn: 111959
2010-08-24Don't assume that all constants with integer types are ConstantInts.Owen Anderson1-2/+11
llvm-svn: 111906
2010-08-18Use ConstantRange to propagate information through value definitions.Owen Anderson1-4/+83
llvm-svn: 111425
2010-08-18Inform LazyValueInfo whenever a block is deleted, to avoid dangling pointer ↵Owen Anderson1-21/+47
issues. llvm-svn: 111382
2010-08-16Fix another iterator invalidation that caused a *really* nasty ↵Owen Anderson1-6/+7
miscompilation in 403.gcc. llvm-svn: 111210
2010-08-11Fix a subtle use-after-free issue.Owen Anderson1-1/+4
llvm-svn: 110863
2010-08-11Improve indentation.Owen Anderson1-27/+28
llvm-svn: 110778
2010-08-10Now that we're using ConstantRange to represent potential values, make use ↵Owen Anderson1-8/+35
of that represenation to create constraints from comparisons other than eq/neq. llvm-svn: 110742
2010-08-10Switch over to using ConstantRange to track integral values.Owen Anderson1-7/+44
llvm-svn: 110714
2010-08-09Add ConstantRange information to the debugging output.Owen Anderson1-0/+3
llvm-svn: 110598
2010-08-05Add the beginnings of infrastructure for range tracking.Owen Anderson1-6/+60
llvm-svn: 110388
2010-08-05Split the tag and value members of LVILatticeVal in preparation for ↵Owen Anderson1-14/+14
expanding the lattice to something that won't fit in two bits. llvm-svn: 110383
2010-07-30Add an initial implementation of PHI translation for LazyValueInfo. This ↵Owen Anderson1-35/+72
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-30Revert my last two patches to LVI, which recent changes have exposed a ↵Owen Anderson1-56/+94
miscompilation in. llvm-svn: 109889
2010-07-28Pass the queried value by argument rather than in a member, in preparation ↵Owen Anderson1-36/+25
for supporting PHI translation. llvm-svn: 109701
2010-07-28Get rid of LVIQuery as a distinct data structure, so that we don't have to ↵Owen Anderson1-93/+66
initialize a new set of maps on every query. llvm-svn: 109679
2010-07-27Rearrange several datastructures in LazyValueInfo to improve compile time.Owen Anderson1-69/+35
This is still not perfect, but better than it was before. llvm-svn: 109563
2010-07-26Add an initial implementation of LazyValueInfo updating for JumpThreading. ↵Owen Anderson1-4/+89
Disabled for now. llvm-svn: 109424
2010-07-21Fix batch of converting RegisterPass<> to INTIALIZE_PASS().Owen Anderson1-2/+2
llvm-svn: 109045