summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Utils/MemorySSA.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/MemorySSA.cpp b/llvm/lib/Transforms/Utils/MemorySSA.cpp
index 382a18b025a..81c8737645b 100644
--- a/llvm/lib/Transforms/Utils/MemorySSA.cpp
+++ b/llvm/lib/Transforms/Utils/MemorySSA.cpp
@@ -253,17 +253,20 @@ MemorySSAWalker *MemorySSA::buildMemorySSA(AliasAnalysis *AA,
// Go through each block, figure out where defs occur, and chain together all
// the accesses.
for (BasicBlock &B : F) {
+ bool InsertIntoDef = false;
AccessListType *Accesses = nullptr;
for (Instruction &I : B) {
MemoryAccess *MA = createNewAccess(&I, true);
if (!MA)
continue;
if (isa<MemoryDef>(MA))
- DefiningBlocks.insert(&B);
+ InsertIntoDef = true;
if (!Accesses)
Accesses = getOrCreateAccessList(&B);
Accesses->push_back(MA);
}
+ if (InsertIntoDef)
+ DefiningBlocks.insert(&B);
}
// Determine where our MemoryPhi's should go
OpenPOWER on IntegriCloud