aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopSimplify.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopSimplify.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LoopSimplify.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopSimplify.cpp b/llvm/lib/Transforms/Utils/LoopSimplify.cpp
index f247a7e..16085f4 100644
--- a/llvm/lib/Transforms/Utils/LoopSimplify.cpp
+++ b/llvm/lib/Transforms/Utils/LoopSimplify.cpp
@@ -647,22 +647,20 @@ ReprocessLoop:
Instruction *Inst = &*I++;
if (Inst == CI)
continue;
- bool InstInvariant = false;
if (!L->makeLoopInvariant(
- Inst, InstInvariant,
+ Inst, AnyInvariant,
Preheader ? Preheader->getTerminator() : nullptr, MSSAU)) {
AllInvariant = false;
break;
}
- if (InstInvariant && SE) {
- // The loop disposition of all SCEV expressions that depend on any
- // hoisted values have also changed.
- SE->forgetBlockAndLoopDispositions(Inst);
- }
- AnyInvariant |= InstInvariant;
}
- if (AnyInvariant)
+ if (AnyInvariant) {
Changed = true;
+ // The loop disposition of all SCEV expressions that depend on any
+ // hoisted values have also changed.
+ if (SE)
+ SE->forgetLoopDispositions();
+ }
if (!AllInvariant) continue;
// The block has now been cleared of all instructions except for