Only insert into definingblocks once per block

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260013 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Berlin 2016-02-07 01:52:15 +00:00
parent f21f097a73
commit 6d8a11a537

View File

@ -253,17 +253,20 @@ MemorySSAWalker *MemorySSA::buildMemorySSA(AliasAnalysis *AA,
// Go through each block, figure out where defs occur, and chain together all // Go through each block, figure out where defs occur, and chain together all
// the accesses. // the accesses.
for (BasicBlock &B : F) { for (BasicBlock &B : F) {
bool InsertIntoDef = false;
AccessListType *Accesses = nullptr; AccessListType *Accesses = nullptr;
for (Instruction &I : B) { for (Instruction &I : B) {
MemoryAccess *MA = createNewAccess(&I, true); MemoryAccess *MA = createNewAccess(&I, true);
if (!MA) if (!MA)
continue; continue;
if (isa<MemoryDef>(MA)) if (isa<MemoryDef>(MA))
DefiningBlocks.insert(&B); InsertIntoDef = true;
if (!Accesses) if (!Accesses)
Accesses = getOrCreateAccessList(&B); Accesses = getOrCreateAccessList(&B);
Accesses->push_back(MA); Accesses->push_back(MA);
} }
if (InsertIntoDef)
DefiningBlocks.insert(&B);
} }
// Determine where our MemoryPhi's should go // Determine where our MemoryPhi's should go