[llvm-branch-commits] [llvm] [AMDGPU] Mark all instructions in WWM region as convergent (PR #204572)
Diana Picus via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Jun 22 02:35:56 PDT 2026
rovka wrote:
> What the motivation here? At the moment early-machinelicm runs before WWM region formation, so the test is speculative on the basis that it _might_ run after WQM pass? Or is this a proxy for machinelicm that runs after RA?
It's a proxy for moving WWM formation really early on (and also it's an existing test that showcases the problem nicely. We could probably add other tests with other optimizations but I haven't spent time on that yet). The main motivation is to prevent things from being moved out of WWM regions (because otherwise we might either end up with a lot of EXEC flipping or in the worst case wrong code).
> My mid-term plan is to separate WWM and WQM formation. Locking down stuff in WWM region as this patch does is probably sensible. However, I haven't seen an argument for moving WWM region formation earlier -- exactly because it blocks various optimizations which are AFAIK safe until marking and region formation has been done.
Oh, oops, I thought it was implied that you were planning to move it earlier rather than later. The comment in the licm-wwm test sounds like an argument for moving WWM formation earlier, before optimizations get a chance to move things out of the region. Furthermore, the main alternative that we have for WWM, the whole wave functions, is even more opaque to optimizations and geared towards keeping things together. So I'm not sure which optimizations we want to keep - it sounds like some of them are unwanted even if they're technically safe.
https://github.com/llvm/llvm-project/pull/204572
More information about the llvm-branch-commits
mailing list