[llvm] [LoopFusion] Forget loop and block dispositions after latch merge (PR #166233)

via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 4 10:56:08 PST 2025


================
@@ -1796,14 +1796,15 @@ struct LoopFuser {
     // mergeLatch may remove the only block in FC1.
     SE.forgetLoop(FC1.L);
     SE.forgetLoop(FC0.L);
-    // Forget block dispositions as well, so that there are no dangling
-    // pointers to erased/free'ed blocks.
-    SE.forgetBlockAndLoopDispositions();
 
     // Move instructions from FC0.Latch to FC1.Latch.
     // Note: mergeLatch requires an updated DT.
     mergeLatch(FC0, FC1);
 
+    // Forget block dispositions as well, so that there are no dangling
+    // pointers to erased/free'ed blocks.
----------------
CongzheUalberta wrote:

// pointers to erased/free'ed blocks.
->
// pointers to erased/free'ed blocks. It should be done after mergeLatch() because...

Same for your change below.

https://github.com/llvm/llvm-project/pull/166233


More information about the llvm-commits mailing list