[LoopRotation] Also drop block dispositions.
authorFlorian Hahn <flo@fhahn.com>
Tue, 11 Oct 2022 14:25:27 +0000 (15:25 +0100)
committerFlorian Hahn <flo@fhahn.com>
Tue, 11 Oct 2022 14:25:27 +0000 (15:25 +0100)
LoopRotation may also fold basic blocks, so cached block dispositions
also need to be dropped.

Fixes #58291.

llvm/lib/Transforms/Utils/LoopRotationUtils.cpp

index da817fb..ce13723 100644 (file)
@@ -349,7 +349,9 @@ bool LoopRotate::rotateLoop(Loop *L, bool SimplifiedLatch) {
       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();
+      // We also may fold basic blocks, so cached block dispositions also need
+      // to be dropped.
+      SE->forgetBlockAndLoopDispositions();
     }
 
     LLVM_DEBUG(dbgs() << "LoopRotation: rotating "; L->dump());