[llvm] [AMDGPU] V_SET_INACTIVE optimizations (PR #98864)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 3 03:00:09 PDT 2024


================
@@ -4,18 +4,39 @@
 define amdgpu_kernel void @set_inactive(ptr addrspace(1) %out, i32 %in) {
 ; GCN-LABEL: set_inactive:
 ; GCN:       ; %bb.0:
-; GCN-NEXT:    s_load_dword s4, s[2:3], 0x2c
+; GCN-NEXT:    s_load_dword s6, s[2:3], 0x2c
 ; GCN-NEXT:    s_load_dwordx2 s[0:1], s[2:3], 0x24
+; GCN-NEXT:    s_or_saveexec_b64 s[4:5], -1
 ; GCN-NEXT:    s_mov_b32 s2, -1
-; GCN-NEXT:    s_waitcnt lgkmcnt(0)
-; GCN-NEXT:    v_mov_b32_e32 v0, s4
-; GCN-NEXT:    s_not_b64 exec, exec
 ; GCN-NEXT:    v_mov_b32_e32 v0, 42
-; GCN-NEXT:    s_not_b64 exec, exec
+; GCN-NEXT:    s_mov_b64 exec, s[4:5]
+; GCN-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-NEXT:    v_mov_b32_e32 v0, s6
+; GCN-NEXT:    s_mov_b64 exec, -1
+; GCN-NEXT:    s_mov_b64 exec, s[4:5]
----------------
jayfoad wrote:

This pair of instructions is redundant. It would be nice to remove them one day.

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


More information about the llvm-commits mailing list