diff options
author | Dan Gohman <gohman@apple.com> | 2011-01-24 18:53:32 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2011-01-24 18:53:32 +0000 |
commit | bd1801b5553c8be3960255a92738464e0010b6f6 (patch) | |
tree | 838d8bf88ac48fbc8cc9df6be1cbc9df3067e2f7 /lib/Analysis/BasicAliasAnalysis.cpp | |
parent | 0e3fae27a1634f51943d06588e32a550dae6a4b9 (diff) | |
download | llvm-bd1801b5553c8be3960255a92738464e0010b6f6.tar.gz llvm-bd1801b5553c8be3960255a92738464e0010b6f6.tar.bz2 llvm-bd1801b5553c8be3960255a92738464e0010b6f6.tar.xz |
Give GetUnderlyingObject a TargetData, to keep it in sync
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124134 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/BasicAliasAnalysis.cpp')
-rw-r--r-- | lib/Analysis/BasicAliasAnalysis.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp index f3695929d1..f7bcd9ec44 100644 --- a/lib/Analysis/BasicAliasAnalysis.cpp +++ b/lib/Analysis/BasicAliasAnalysis.cpp @@ -554,7 +554,7 @@ BasicAliasAnalysis::pointsToConstantMemory(const Location &Loc, bool OrLocal) { SmallVector<const Value *, 16> Worklist; Worklist.push_back(Loc.Ptr); do { - const Value *V = GetUnderlyingObject(Worklist.pop_back_val()); + const Value *V = GetUnderlyingObject(Worklist.pop_back_val(), TD); if (!Visited.insert(V)) { Visited.clear(); return AliasAnalysis::pointsToConstantMemory(Loc, OrLocal); @@ -659,7 +659,7 @@ BasicAliasAnalysis::getModRefInfo(ImmutableCallSite CS, assert(notDifferentParent(CS.getInstruction(), Loc.Ptr) && "AliasAnalysis query involving multiple functions!"); - const Value *Object = GetUnderlyingObject(Loc.Ptr); + const Value *Object = GetUnderlyingObject(Loc.Ptr, TD); // If this is a tail call and Loc.Ptr points to a stack location, we know that // the tail call cannot access or modify the local stack. @@ -787,7 +787,7 @@ BasicAliasAnalysis::getModRefInfo(ImmutableCallSite CS, /// aliasGEP - Provide a bunch of ad-hoc rules to disambiguate a GEP instruction /// against another pointer. We know that V1 is a GEP, but we don't know -/// anything about V2. UnderlyingV1 is GetUnderlyingObject(GEP1), +/// anything about V2. UnderlyingV1 is GetUnderlyingObject(GEP1, TD), /// UnderlyingV2 is the same for V2. /// AliasAnalysis::AliasResult @@ -1070,8 +1070,8 @@ BasicAliasAnalysis::aliasCheck(const Value *V1, uint64_t V1Size, return NoAlias; // Scalars cannot alias each other // Figure out what objects these things are pointing to if we can. - const Value *O1 = GetUnderlyingObject(V1); - const Value *O2 = GetUnderlyingObject(V2); + const Value *O1 = GetUnderlyingObject(V1, TD); + const Value *O2 = GetUnderlyingObject(V2, TD); // Null values in the default address space don't point to any object, so they // don't alias any other pointer. |