diff options
author | Alina Sbirlea <asbirlea@google.com> | 2018-11-13 21:12:49 +0000 |
---|---|---|
committer | Alina Sbirlea <asbirlea@google.com> | 2018-11-13 21:12:49 +0000 |
commit | b4d088d090a035ec174ded571e6a7058adf11fef (patch) | |
tree | 6d5a3dc1b4dd666e3d53242e40f06f04ca89543c | |
parent | 807a8bae933a8798a40aed254dd53f533d8cee16 (diff) | |
download | bcm5719-llvm-b4d088d090a035ec174ded571e6a7058adf11fef.tar.gz bcm5719-llvm-b4d088d090a035ec174ded571e6a7058adf11fef.zip |
[MemorySSA] Create query after checking if instruction is a fence.
The alternative is checking if I is a fence in the Query constructor, so
as to not attempt to get a non-existent MemoryLocation.
llvm-svn: 346798
-rw-r--r-- | llvm/lib/Analysis/MemorySSA.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/MemorySSA.cpp b/llvm/lib/Analysis/MemorySSA.cpp index 1e45cc4bdf8..3d98fca823a 100644 --- a/llvm/lib/Analysis/MemorySSA.cpp +++ b/llvm/lib/Analysis/MemorySSA.cpp @@ -2199,13 +2199,14 @@ MemorySSA::CachingWalker::getClobberingMemoryAccess(MemoryAccess *MA) { return StartingAccess->getOptimized(); const Instruction *I = StartingAccess->getMemoryInst(); - UpwardsMemoryQuery Q(I, StartingAccess); // We can't sanely do anything with a fence, since they conservatively clobber // all memory, and have no locations to get pointers from to try to // disambiguate. - if (!Q.IsCall && I->isFenceLike()) + if (!ImmutableCallSite(I) && I->isFenceLike()) return StartingAccess; + UpwardsMemoryQuery Q(I, StartingAccess); + if (isUseTriviallyOptimizableToLiveOnEntry(*MSSA->AA, I)) { MemoryAccess *LiveOnEntry = MSSA->getLiveOnEntryDef(); StartingAccess->setOptimized(LiveOnEntry); |