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
// 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