aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/BasicAliasAnalysis.cpp
AgeCommit message (Collapse)AuthorFilesLines
2011-07-27Explicitly cast narrowing conversions inside {}s that will become errors inJeffrey Yasskin1-1/+2
C++0x. llvm-svn: 136211
2011-07-18land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner1-2/+2
llvm-svn: 135375
2011-06-10Initialize BasicAA's AliasCache to set it to use fewer buckets byDan Gohman1-1/+7
default, since it usually has very few elements. This speeds up alias queries in many cases, because AliasCache.clear() doesn't have to visit as many buckets. llvm-svn: 132862
2011-06-04Reapply r131781, now that the GVN bug with partially-aliasing loadsDan Gohman1-1/+11
is disabled. llvm-svn: 132632
2011-06-04Revert r131781 again. Apparently there is more going on here.Dan Gohman1-11/+1
llvm-svn: 132625
2011-06-04Reapply r131781 (revert r131809), now that some BasicAA shortcomingsDan Gohman1-1/+11
it exposed are fixed. llvm-svn: 132611
2011-06-04Fix BasicAA's recursion detection so that it doesn't pessimizeDan Gohman1-37/+27
queries in the case of a DAG, where a query reaches a node visited earlier, but it's not on a cycle. This avoids MayAlias results in cases where BasicAA is expected to return MustAlias or PartialAlias in order to protect TBAA. llvm-svn: 132609
2011-06-03When merging MustAlias and PartialAlias, chose PartialAlias insteadDan Gohman1-10/+21
of conservatively choosing MayAlias. llvm-svn: 132579
2011-05-24Make DecomposeGEPExpression check SimplifyInstruction onlyDan Gohman1-9/+12
after checking for a GEP, so that it matches what GetUnderlyingObject does. This fixes an obscure bug turned up by bugpoint in the testcase for PR9931. llvm-svn: 131971
2011-05-23fix a really nasty basicaa mod/ref calculation bug that was causing ↵Chris Lattner1-2/+5
miscompilation of UnitTests/ObjC/messages-2.m with the recent optimizer improvements. llvm-svn: 131897
2011-05-21Revert commit 131781, to see if it fixes the x86-64 dragonegg buildbot.Duncan Sands1-11/+1
Original log message: When BasicAA can determine that two pointers have the same base but differ by a dynamic offset, return PartialAlias instead of MayAlias. See the comment in the code for details. This fixes PR9971. llvm-svn: 131809
2011-05-21When BasicAA can determine that two pointers have the same base butDan Gohman1-1/+11
differ by a dynamic offset, return PartialAlias instead of MayAlias. See the comment in the code for details. This fixes PR9971. llvm-svn: 131781
2011-04-27Teach BasicAA about arm.neon.vld1 and vst1.Dan Gohman1-0/+20
llvm-svn: 130327
2011-04-15Fix a ton of comment typos found by codespell. Patch byChris Lattner1-2/+2
Luis Felipe Strano Moraes! llvm-svn: 129558
2011-03-23Revert r128140 for now.Anders Carlsson1-33/+0
llvm-svn: 128149
2011-03-23A global variable with internal linkage where all uses are in one function ↵Anders Carlsson1-0/+33
and whose address is never taken is a non-escaping local object and can't alias anything else. llvm-svn: 128140
2011-01-24Give GetUnderlyingObject a TargetData, to keep it in syncDan Gohman1-5/+5
with BasicAA's DecomposeGEPExpression, which recently began using a TargetData. This fixes PR8968, though the testcase is awkward to reduce. Also, update several off GetUnderlyingObject's users which happen to have a TargetData handy to pass it in. llvm-svn: 124134
2011-01-18Teach BasicAA to return PartialAlias in cases where both pointersDan Gohman1-12/+35
are pointing to the same object, one pointer is accessing the entire object, and the other is access has a non-zero size. This prevents TBAA from kicking in and saying NoAlias in such cases. llvm-svn: 123775
2011-01-03fix rdar://8813415 - a miscompilation of 164.gzip that loop-idiomChris Lattner1-0/+2
exposed. It turns out to be a latent bug in basicaa, scary. llvm-svn: 122772
2010-12-15Reapply r121886, and also update DecomposeGEPExpression to keepDan Gohman1-0/+9
it in sync. llvm-svn: 121895
2010-12-15Move Value::getUnderlyingObject to be a standaloneDan Gohman1-8/+8
function so that it can live in Analysis instead of VMCore. llvm-svn: 121885
2010-12-13Reapply r121520, PartialAlias implementation for BasicAA, now thatDan Gohman1-0/+11
memdep is updated to handle it. llvm-svn: 121725
2010-12-10Revert r121520, which may have introduced miscompilations.Dan Gohman1-11/+0
llvm-svn: 121573
2010-12-10Implement PartialAlias checking in BasicAA.Dan Gohman1-0/+11
llvm-svn: 121520
2010-12-07PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() andJay Foad1-4/+4
zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method trunc(), to be const and to return a new value instead of modifying the object in place. llvm-svn: 121120
2010-11-30enhance basicaa to return "Mod" for a memcpy call when theChris Lattner1-0/+5
queried location doesn't overlap the source, and add a testcase. llvm-svn: 120370
2010-11-30Teach basicaa that memset's modref set is at worst "mod" and neverChris Lattner1-0/+2
contains "ref". Enhance DSE to use a modref query instead of a store-specific hack to generalize the "ignore may-alias stores" optimization to handle memset and memcpy. llvm-svn: 120368
2010-11-10Make ModRefBehavior a lattice. Use this to clean up AliasAnalysisDan Gohman1-5/+9
chaining and simplify FunctionAttrs' GetModRefBehavior logic. llvm-svn: 118660
2010-11-08Re-introduce the MaxLookup limit to BasicAliasAnalysis'Dan Gohman1-2/+8
pointsToConstantMemory code to guard against possible compile time slowdowns. llvm-svn: 118440
2010-11-08Extend the AliasAnalysis::pointsToConstantMemory interface to allow itDan Gohman1-11/+54
to optionally look for constant or local (alloca) memory. Teach BasicAliasAnalysis::pointsToConstantMemory to look through Select and Phi nodes, and to support looking for local memory. Remove FunctionAttrs' PointsToLocalOrConstantMemory function, now that AliasAnalysis knows all the tricks that it knew. llvm-svn: 118412
2010-11-08Teach BasicAliasAnalysis::getModRefBehavior(const Function *F)Dan Gohman1-3/+11
to analyze intrinsic functions. llvm-svn: 118409
2010-10-19Move NoAA out of BasicAliasAnalysis.cpp into its own file, now thatDan Gohman1-81/+8
it doesn't have a special relationship with BasicAliasAnalysis anymore. llvm-svn: 116876
2010-10-19Reapply r116831 and r116839, converting AliasAnalysis to useDan Gohman1-24/+26
uint64_t, plus fixes for places I missed before. llvm-svn: 116875
2010-10-19Revert r116831 and r116839, which are breaking selfhost builds.Dan Gohman1-26/+24
llvm-svn: 116858
2010-10-19Change AliasAnalysis and its clients to use uint64_t instead of unsignedDan Gohman1-24/+26
for representing object sizes, for consistency with other parts of LLVM. llvm-svn: 116831
2010-10-19Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson1-3/+7
exposes an initializeMyPassFunction(), which must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize the pass's dependencies. Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h before parsing commandline arguments. I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass registration/creation, please send the testcase to me directly. llvm-svn: 116820
2010-10-18Fix BasicAA to pass TBAAInfo through to the chained analysis.Dan Gohman1-26/+47
llvm-svn: 116730
2010-10-18Make BasicAliasAnalysis a normal AliasAnalysis implementation whichDan Gohman1-11/+25
does normal initialization and normal chaining. Change the default AliasAnalysis implementation to NoAlias. Update StandardCompileOpts.h and friends to explicitly request BasicAliasAnalysis. Update tests to explicitly request -basicaa. llvm-svn: 116720
2010-10-07Now with fewer extraneous semicolons!Owen Anderson1-2/+2
llvm-svn: 115996
2010-09-15PR7959: Handle negative scales in GEPs correctly in BasicAA for non-64-bitEli Friedman1-3/+3
targets. llvm-svn: 114015
2010-09-14Remove the experimental AliasAnalysis::getDependency interface, whichDan Gohman1-55/+34
isn't a good level of abstraction for memdep. Instead, generalize AliasAnalysis::alias and related interfaces with a new Location class for describing a memory location. For now, this is the same Pointer and Size as before, plus an additional field for a TBAA tag. Also, introduce a fixed MD_tbaa metadata tag kind. llvm-svn: 113858
2010-09-09Extend the getDependence query with support for PHI translation.Dan Gohman1-1/+8
llvm-svn: 113521
2010-09-08Add a new experimental generalized dependence query interface toDan Gohman1-0/+20
AliasAnalysis, and some code for implementing the new query on top of existing implementations by making standard alias and getModRefInfo queries. llvm-svn: 113329
2010-08-18refix PR1143 by making basicaa analyze zexts of indices aggresively,Chris Lattner1-11/+30
which I broke with a recent patch. llvm-svn: 111452
2010-08-18GetLinearExpression is only called when TD is non-null, pass as Chris Lattner1-4/+4
a reference instead of pointer. llvm-svn: 111445
2010-08-18rework GEP decomposition to make a new VariableGEPIndex struct instead ofChris Lattner1-19/+39
using a pair. This tidies up the code a bit. While setting things up, add a (currently unused) field to keep track of how the value is extended. llvm-svn: 111444
2010-08-18move gep decomposition out of ValueTracking into BasicAA. The form ofChris Lattner1-34/+229
decomposition that it is doing is very basicaa specific and is only used by basicaa. Now with less tree breakingness. llvm-svn: 111433
2010-08-18Revert r111375, "move gep decomposition out of ValueTracking into BasicAA. TheDaniel Dunbar1-213/+34
form of", it doesn't pass tests. llvm-svn: 111385
2010-08-18move gep decomposition out of ValueTracking into BasicAA. The form ofChris Lattner1-34/+213
decomposition that it is doing is very basicaa specific and is only used by basicaa. llvm-svn: 111375
2010-08-06Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson1-7/+7
llvm-svn: 110460