[NFC] Use forgetTopmostLoop instead of logic duplication

llvm-svn: 330683
This commit is contained in:
Max Kazantsev 2018-04-24 04:33:04 +00:00
parent 19b85103a3
commit 30dee7874d
1 changed files with 2 additions and 6 deletions

View File

@ -511,12 +511,8 @@ LoopUnrollResult llvm::UnrollLoop(
// and if something changes inside them then any of outer loops may also
// change. When we forget outermost loop, we also forget all contained loops
// and this is what we need here.
if (SE) {
const Loop *CurrL = L;
while (const Loop *ParentL = CurrL->getParentLoop())
CurrL = ParentL;
SE->forgetLoop(CurrL);
}
if (SE)
SE->forgetTopmostLoop(L);
bool ContinueOnTrue = L->contains(BI->getSuccessor(0));
BasicBlock *LoopExit = BI->getSuccessor(ContinueOnTrue);