summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/MemorySSA.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Utils/MemorySSA.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/MemorySSA.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Utils/MemorySSA.cpp b/llvm/lib/Transforms/Utils/MemorySSA.cpp
index 0aed1334571..f93917f9861 100644
--- a/llvm/lib/Transforms/Utils/MemorySSA.cpp
+++ b/llvm/lib/Transforms/Utils/MemorySSA.cpp
@@ -1252,7 +1252,7 @@ MemoryAccess *MemorySSA::CachingWalker::getClobberingMemoryAccess(
// Conservatively, fences are always clobbers, so don't perform the walk if we
// hit a fence.
- if (isa<FenceInst>(I))
+ if (!ImmutableCallSite(I) && I->isFenceLike())
return StartingUseOrDef;
UpwardsMemoryQuery Q;
@@ -1287,15 +1287,17 @@ MemorySSA::CachingWalker::getClobberingMemoryAccess(const Instruction *I) {
// access, since we only map BB's to PHI's. So, this must be a use or def.
auto *StartingAccess = cast<MemoryUseOrDef>(MSSA->getMemoryAccess(I));
- // We can't sanely do anything with a FenceInst, they conservatively
+ bool IsCall = bool(ImmutableCallSite(I));
+
+ // We can't sanely do anything with a fences, they conservatively
// clobber all memory, and have no locations to get pointers from to
- // try to disambiguate
- if (isa<FenceInst>(I))
+ // try to disambiguate.
+ if (!IsCall && I->isFenceLike())
return StartingAccess;
UpwardsMemoryQuery Q;
Q.OriginalAccess = StartingAccess;
- Q.IsCall = bool(ImmutableCallSite(I));
+ Q.IsCall = IsCall;
if (!Q.IsCall)
Q.StartingLoc = MemoryLocation::get(I);
Q.Inst = I;
OpenPOWER on IntegriCloud