[llvm] [AMDGPU][SIInsertWaitcnts] Do not add s_waitcnt when the counters are known to be 0 already (PR #72830)

Juan Manuel Martinez CaamaƱo via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 26 14:27:33 PST 2023


================
@@ -45,6 +45,7 @@ define void @back_off_barrier_no_fence(ptr %in, ptr %out) #0 {
 ; GFX11-BACKOFF-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
 ; GFX11-BACKOFF-NEXT:    flat_load_b32 v0, v[0:1]
 ; GFX11-BACKOFF-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
+; GFX11-BACKOFF-NEXT:    s_waitcnt_vscnt null, 0x0
----------------
jmmartinez wrote:

Hello!

In an initial version of the patch, before we introduced de soft-waitcnts, setting the counters to 0 in the initial state would end up removing the "s_waitcnt 0" placed at non-kernel function entry. This is not needed anymore since we make the distinction between soft/strong waitcnts. However, we still have to do it for vscnt as jay said.

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


More information about the llvm-commits mailing list