[llvm] be611ef - [LoopRotation] Also drop block dispositions.

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 11 07:25:49 PDT 2022


Author: Florian Hahn
Date: 2022-10-11T15:25:27+01:00
New Revision: be611ef7faedd5e1f23975598840ccb2018bc100

URL: https://github.com/llvm/llvm-project/commit/be611ef7faedd5e1f23975598840ccb2018bc100
DIFF: https://github.com/llvm/llvm-project/commit/be611ef7faedd5e1f23975598840ccb2018bc100.diff

LOG: [LoopRotation] Also drop block dispositions.

LoopRotation may also fold basic blocks, so cached block dispositions
also need to be dropped.

Fixes #58291.

Added: 
    

Modified: 
    llvm/lib/Transforms/Utils/LoopRotationUtils.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp b/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
index da817fbe3ea3..ce1372366994 100644
--- a/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
+++ b/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
@@ -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());


        


More information about the llvm-commits mailing list