[llvm] [WebAssembly] Incorporate SCCs into WebAssemblyFixIrreducibleControlFlow (PR #181755)

Demetrius Kanios via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 18 11:56:47 PST 2026


QuantumSegfault wrote:

> Just as a FYI, LLVM nowadays also has CycleInfo, which is like LoopInfo but supporting irreducible cycles. Not sure whether that is useful here or not as I'm not familiar with the requirements of this code.

I took a quick look and it COULD work... but I think it would require an even more invasive change than this. The way I see it the main benefit is that we could detect all the cycles from the start, and actually update the graph (`GenericCycle::setSingleEntry`) in-place rather than recalculate the whole thing each time we fix some irreduciblity. But I hesitate to try that when we have something here that works, and that already is a MAJOR performance boost. But I suppose experimenting with it couldn't hurt (I don't have anything better to work on ATM).

The other thing is getting the generated code to be the exact same is going to be difficult? We currently sort to process the loops in a stable order. CycleInfo is probably determinstic, but iterating over them seems likely to happen in a different, unspecified order. Might be able to compensate though.

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


More information about the llvm-commits mailing list