aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/GlobalsModRef.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis/GlobalsModRef.cpp')
-rw-r--r--llvm/lib/Analysis/GlobalsModRef.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/Analysis/GlobalsModRef.cpp b/llvm/lib/Analysis/GlobalsModRef.cpp
index 145baf82b65b..d00a7c944f10 100644
--- a/llvm/lib/Analysis/GlobalsModRef.cpp
+++ b/llvm/lib/Analysis/GlobalsModRef.cpp
@@ -828,9 +828,9 @@ AliasResult GlobalsAAResult::alias(const MemoryLocation &LocA,
AAQueryInfo &AAQI) {
// Get the base object these pointers point to.
const Value *UV1 =
- getUnderlyingObject(LocA.Ptr->stripPointerCastsAndInvariantGroups());
+ getUnderlyingObject(LocA.Ptr->stripPointerCastsForAliasAnalysis());
const Value *UV2 =
- getUnderlyingObject(LocB.Ptr->stripPointerCastsAndInvariantGroups());
+ getUnderlyingObject(LocB.Ptr->stripPointerCastsForAliasAnalysis());
// If either of the underlying values is a global, they may be non-addr-taken
// globals, which we can answer queries about.
@@ -847,14 +847,14 @@ AliasResult GlobalsAAResult::alias(const MemoryLocation &LocA,
// If the two pointers are derived from two different non-addr-taken
// globals we know these can't alias.
if (GV1 && GV2 && GV1 != GV2)
- return NoAlias;
+ return AliasResult::NoAlias;
// If one is and the other isn't, it isn't strictly safe but we can fake
// this result if necessary for performance. This does not appear to be
// a common problem in practice.
if (EnableUnsafeGlobalsModRefAliasResults)
if ((GV1 || GV2) && GV1 != GV2)
- return NoAlias;
+ return AliasResult::NoAlias;
// Check for a special case where a non-escaping global can be used to
// conclude no-alias.
@@ -862,7 +862,7 @@ AliasResult GlobalsAAResult::alias(const MemoryLocation &LocA,
const GlobalValue *GV = GV1 ? GV1 : GV2;
const Value *UV = GV1 ? UV2 : UV1;
if (isNonEscapingGlobalNoAlias(GV, UV))
- return NoAlias;
+ return AliasResult::NoAlias;
}
// Otherwise if they are both derived from the same addr-taken global, we
@@ -893,14 +893,14 @@ AliasResult GlobalsAAResult::alias(const MemoryLocation &LocA,
// use this to disambiguate the pointers. If the pointers are based on
// different indirect globals they cannot alias.
if (GV1 && GV2 && GV1 != GV2)
- return NoAlias;
+ return AliasResult::NoAlias;
// If one is based on an indirect global and the other isn't, it isn't
// strictly safe but we can fake this result if necessary for performance.
// This does not appear to be a common problem in practice.
if (EnableUnsafeGlobalsModRefAliasResults)
if ((GV1 || GV2) && GV1 != GV2)
- return NoAlias;
+ return AliasResult::NoAlias;
return AAResultBase::alias(LocA, LocB, AAQI);
}
@@ -925,7 +925,7 @@ ModRefInfo GlobalsAAResult::getModRefInfoForArgument(const CallBase *Call,
!all_of(Objects, [&](const Value *V) {
return this->alias(MemoryLocation::getBeforeOrAfter(V),
MemoryLocation::getBeforeOrAfter(GV),
- AAQI) == NoAlias;
+ AAQI) == AliasResult::NoAlias;
}))
return ConservativeResult;