summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/MemorySSAUpdater.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis/MemorySSAUpdater.cpp')
-rw-r--r--llvm/lib/Analysis/MemorySSAUpdater.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/MemorySSAUpdater.cpp b/llvm/lib/Analysis/MemorySSAUpdater.cpp
index fe84ca1207e..3f3fd998d5c 100644
--- a/llvm/lib/Analysis/MemorySSAUpdater.cpp
+++ b/llvm/lib/Analysis/MemorySSAUpdater.cpp
@@ -156,8 +156,10 @@ MemoryAccess *MemorySSAUpdater::getPreviousDefFromEnd(
DenseMap<BasicBlock *, TrackingVH<MemoryAccess>> &CachedPreviousDef) {
auto *Defs = MSSA->getWritableBlockDefs(BB);
- if (Defs)
+ if (Defs) {
+ CachedPreviousDef.insert({BB, &*Defs->rbegin()});
return &*Defs->rbegin();
+ }
return getPreviousDefRecursive(BB, CachedPreviousDef);
}
OpenPOWER on IntegriCloud