[llvm] [WebAssembly] Replace Reachability with SCCs in Irreducible CFG Fixer (PR #179722)

Petr Penzin via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 9 15:48:10 PST 2026


================
@@ -120,65 +113,134 @@ class ReachabilityGraph {
     assert(I != LoopEnterers.end());
     return I->second;
   }
+  unsigned getSCCId(MachineBasicBlock *MBB) const {
+    return SccId[getIndex(MBB)];
----------------
ppenzin wrote:

Maybe to paraphrase the question, do you expect `inRegion` to always be true, whichever of the two ways it is defined? If it is valid for the algorithm to not be in region, then there should be a valid execution flow for that.

Additional mir tests would probably be necessary.

I think version in `getIndex` is fine - otherwise you'd have to essentially look for the block twice

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


More information about the llvm-commits mailing list