diff options
author | Sam McCall <sam.mccall@gmail.com> | 2017-01-30 09:19:50 +0000 |
---|---|---|
committer | Sam McCall <sam.mccall@gmail.com> | 2017-01-30 09:19:50 +0000 |
commit | b9d6c10c2d6e5fdee59bd91e21edeef73ed51577 (patch) | |
tree | ea5a4a975c3574cccd8e27d9fd488b1eb4dfa11b /llvm/lib | |
parent | 65a12c012f7ec5095d58ec06ba956c92439600bb (diff) | |
download | bcm5719-llvm-b9d6c10c2d6e5fdee59bd91e21edeef73ed51577.tar.gz bcm5719-llvm-b9d6c10c2d6e5fdee59bd91e21edeef73ed51577.zip |
[MemorySSA] Revert r293361 and r293363, as the tests fail under asan.
llvm-svn: 293471
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Utils/MemorySSA.cpp | 15 | ||||
-rw-r--r-- | llvm/lib/Transforms/Utils/MemorySSAUpdater.cpp | 24 |
2 files changed, 12 insertions, 27 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; diff --git a/llvm/lib/Transforms/Utils/MemorySSAUpdater.cpp b/llvm/lib/Transforms/Utils/MemorySSAUpdater.cpp index 511ad9c42a1..792ddef4e70 100644 --- a/llvm/lib/Transforms/Utils/MemorySSAUpdater.cpp +++ b/llvm/lib/Transforms/Utils/MemorySSAUpdater.cpp @@ -243,17 +243,13 @@ void MemorySSAUpdater::insertDef(MemoryDef *MD) { // of that thing with us, since we are in the way of whatever was there // before. // We now define that def's memorydefs and memoryphis - if (DefBeforeSameBlock) { - for (auto UI = DefBefore->use_begin(), UE = DefBefore->use_end(); - UI != UE;) { - Use &U = *UI++; - // Leave the uses alone - if (isa<MemoryUse>(U.getUser())) - continue; - U.set(MD); - } + for (auto UI = DefBefore->use_begin(), UE = DefBefore->use_end(); UI != UE;) { + Use &U = *UI++; + // Leave the uses alone + if (isa<MemoryUse>(U.getUser())) + continue; + U.set(MD); } - // and that def is now our defining access. // We change them in this order otherwise we will appear in the use list // above and reset ourselves. @@ -349,9 +345,8 @@ void MemorySSAUpdater::fixupDefs(const SmallVectorImpl<MemoryAccess *> &Vars) { } // Move What before Where in the MemorySSA IR. -template <class WhereType> void MemorySSAUpdater::moveTo(MemoryUseOrDef *What, BasicBlock *BB, - WhereType Where) { + MemorySSA::AccessList::iterator Where) { // Replace all our users with our defining access. What->replaceAllUsesWith(What->getDefiningAccess()); @@ -364,7 +359,6 @@ void MemorySSAUpdater::moveTo(MemoryUseOrDef *What, BasicBlock *BB, else insertUse(cast<MemoryUse>(What)); } - // Move What before Where in the MemorySSA IR. void MemorySSAUpdater::moveBefore(MemoryUseOrDef *What, MemoryUseOrDef *Where) { moveTo(What, Where->getBlock(), Where->getIterator()); @@ -375,8 +369,4 @@ void MemorySSAUpdater::moveAfter(MemoryUseOrDef *What, MemoryUseOrDef *Where) { moveTo(What, Where->getBlock(), ++Where->getIterator()); } -void MemorySSAUpdater::moveToPlace(MemoryUseOrDef *What, BasicBlock *BB, - MemorySSA::InsertionPlace Where) { - return moveTo(What, BB, Where); -} } // namespace llvm |