[llvm] r330683 - [NFC] Use forgetTopmostLoop instead of logic duplication
Max Kazantsev via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 23 21:33:04 PDT 2018
Author: mkazantsev
Date: Mon Apr 23 21:33:04 2018
New Revision: 330683
URL: http://llvm.org/viewvc/llvm-project?rev=330683&view=rev
Log:
[NFC] Use forgetTopmostLoop instead of logic duplication
Modified:
llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp
Modified: llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp?rev=330683&r1=330682&r2=330683&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp Mon Apr 23 21:33:04 2018
@@ -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);
More information about the llvm-commits
mailing list