Skip to content

Commit

Permalink
Revert "[LoopUtils] Updated deleteDeadLoop() to handle loop nest."
Browse files Browse the repository at this point in the history
This reverts commit cd09fee.
This reverts commit c066ff1.
  • Loading branch information
Whitney Tsang committed Dec 17, 2019
1 parent 0bc3336 commit ec4749e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 103 deletions.
13 changes: 1 addition & 12 deletions llvm/lib/Transforms/Utils/LoopUtils.cpp
Expand Up @@ -673,18 +673,7 @@ void llvm::deleteDeadLoop(Loop *L, DominatorTree *DT = nullptr,
LI->removeBlock(BB);

// The last step is to update LoopInfo now that we've eliminated this loop.
// Note: LoopInfo::erase remove the given loop and relink its subloops with
// its parent. While removeLoop/removeChildLoop remove the given loop but
// not relink its subloops, which is what we want.
if (Loop *ParentLoop = L->getParentLoop()) {
Loop::iterator I = find(ParentLoop->begin(), ParentLoop->end(), L);
assert(I != ParentLoop->end() && "Couldn't find loop");
ParentLoop->removeChildLoop(I);
} else {
Loop::iterator I = find(LI->begin(), LI->end(), L);
assert(I != LI->end() && "Couldn't find loop");
LI->removeLoop(I);
}
LI->erase(L);
}
}

Expand Down
1 change: 0 additions & 1 deletion llvm/unittests/Transforms/Utils/CMakeLists.txt
Expand Up @@ -15,7 +15,6 @@ add_llvm_unittest(UtilsTests
FunctionComparatorTest.cpp
IntegerDivisionTest.cpp
LocalTest.cpp
LoopUtilsTest.cpp
SizeOptsTest.cpp
SSAUpdaterBulkTest.cpp
UnrollLoopTest.cpp
Expand Down
90 changes: 0 additions & 90 deletions llvm/unittests/Transforms/Utils/LoopUtilsTest.cpp

This file was deleted.

0 comments on commit ec4749e

Please sign in to comment.