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

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 22 19:52: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);
+    }
----------------
shiltian wrote:

does it mean that we indeed need to update `Predicates` here? I thought the no-update was on purpose.

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


More information about the llvm-commits mailing list