aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopRotationUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LoopRotationUtils.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp b/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
index 7bb7cea..da817fb 100644
--- a/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
+++ b/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
@@ -345,8 +345,12 @@ bool LoopRotate::rotateLoop(Loop *L, bool SimplifiedLatch) {
// all outer loops because insertion and deletion of blocks that happens
// during the rotation may violate invariants related to backedge taken
// infos in them.
- if (SE)
+ if (SE) {
SE->forgetTopmostLoop(L);
+ // We may hoist some instructions out of loop. In case if they were cached
+ // as "loop variant" or "loop computable", these caches must be dropped.
+ SE->forgetLoopDispositions();
+ }
LLVM_DEBUG(dbgs() << "LoopRotation: rotating "; L->dump());
if (MSSAU && VerifyMemorySSA)