[llvm] [AMDGPU] Make WaitcntBrackets::simplifyWaitcnt const again (PR #173390)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 23 08:00:08 PST 2025


================
@@ -28,6 +28,7 @@ define amdgpu_kernel void @test_move_load_address_to_vgpr(ptr addrspace(1) nocap
 ; GCN-NEXT:    s_wait_dscnt 0x0
 ; GCN-NEXT:    flat_load_b32 v3, v[0:1] scope:SCOPE_SYS
 ; GCN-NEXT:    s_wait_loadcnt 0x0
+; GCN-NEXT:    s_wait_xcnt 0x0
----------------
jayfoad wrote:

This is unintended but I'd like to fix it separately. The first time we process this block we eagerly promote `S_WAIT_LOADCNT_soft 0` to `S_WAIT_LOADCNT 0`. The second time it looks like a required (non-soft) wait, which inhibits the optimization that simplifies away the wait for xcnt.

I think for this reason and others we really need to delay the promotion of soft to non-soft waits until after the iteration has reached a fixed point.

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


More information about the llvm-commits mailing list