diff options
Diffstat (limited to 'llvm/lib/Transforms/Utils/MemorySSA.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/MemorySSA.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/llvm/lib/Transforms/Utils/MemorySSA.cpp b/llvm/lib/Transforms/Utils/MemorySSA.cpp index af4dc028b85..50006cef477 100644 --- a/llvm/lib/Transforms/Utils/MemorySSA.cpp +++ b/llvm/lib/Transforms/Utils/MemorySSA.cpp @@ -1597,7 +1597,6 @@ void MemorySSA::insertIntoListsForBlock(MemoryAccess *NewAccess, Defs->push_back(*NewAccess); } } - BlockNumberingValid.erase(BB); } void MemorySSA::insertIntoListsBefore(MemoryAccess *What, const BasicBlock *BB, @@ -1625,7 +1624,6 @@ void MemorySSA::insertIntoListsBefore(MemoryAccess *What, const BasicBlock *BB, Defs->insert(InsertPt->getDefsIterator(), *What); } } - BlockNumberingValid.erase(BB); } // Move What before Where in the IR. The end result is taht What will belong to @@ -1640,19 +1638,13 @@ void MemorySSA::moveTo(MemoryUseOrDef *What, BasicBlock *BB, insertIntoListsBefore(What, BB, Where); } -void MemorySSA::moveTo(MemoryUseOrDef *What, BasicBlock *BB, - InsertionPlace Point) { - removeFromLists(What, false); - What->setBlock(BB); - insertIntoListsForBlock(What, BB, Point); -} - MemoryPhi *MemorySSA::createMemoryPhi(BasicBlock *BB) { assert(!getMemoryAccess(BB) && "MemoryPhi already exists for this BB"); MemoryPhi *Phi = new MemoryPhi(BB->getContext(), BB, NextID++); - // Phi's always are placed at the front of the block. insertIntoListsForBlock(Phi, BB, Beginning); ValueToMemoryAccess[BB] = Phi; + // Phi's always are placed at the front of the block. + BlockNumberingValid.erase(BB); return Phi; } @@ -1673,6 +1665,7 @@ MemoryAccess *MemorySSA::createMemoryAccessInBB(Instruction *I, InsertionPlace Point) { MemoryUseOrDef *NewAccess = createDefinedAccess(I, Definition); insertIntoListsForBlock(NewAccess, BB, Point); + BlockNumberingValid.erase(BB); return NewAccess; } @@ -1682,6 +1675,7 @@ MemoryUseOrDef *MemorySSA::createMemoryAccessBefore(Instruction *I, assert(I->getParent() == InsertPt->getBlock() && "New and old access must be in the same block"); MemoryUseOrDef *NewAccess = createDefinedAccess(I, Definition); + BlockNumberingValid.erase(InsertPt->getBlock()); insertIntoListsBefore(NewAccess, InsertPt->getBlock(), InsertPt->getIterator()); return NewAccess; @@ -1693,6 +1687,7 @@ MemoryUseOrDef *MemorySSA::createMemoryAccessAfter(Instruction *I, assert(I->getParent() == InsertPt->getBlock() && "New and old access must be in the same block"); MemoryUseOrDef *NewAccess = createDefinedAccess(I, Definition); + BlockNumberingValid.erase(InsertPt->getBlock()); insertIntoListsBefore(NewAccess, InsertPt->getBlock(), ++(InsertPt->getIterator())); return NewAccess; |