[llvm] [StructurizeCFG] Fix a crash caused by not updating `Predicates` properly (PR #124051)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 22 19:49:11 PST 2025


================
@@ -971,6 +971,10 @@ void StructurizeCFG::changeExit(RegionNode *Node, BasicBlock *NewExit,
     SubRegion->replaceExit(NewExit);
   } else {
     BasicBlock *BB = Node->getNodeAs<BasicBlock>();
+    for (BasicBlock *Succ : successors(BB)) {
+      if (Succ != NewExit)
+        Predicates[Succ].erase(BB);
+    }
----------------
arsenm wrote:

Probably should move this into killTerminator where the actual successor removal occurs 

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


More information about the llvm-commits mailing list