Skip to content

Commit 2448b0e

Browse files
committed
[AMDGPU] New test for WQM and llvm.amdgcn.init.exec
1 parent 5f5282e commit 2448b0e

File tree

1 file changed

+46
-0
lines changed
  • llvm/test/CodeGen/AMDGPU

1 file changed

+46
-0
lines changed

llvm/test/CodeGen/AMDGPU/wqm.ll

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3312,6 +3312,52 @@ main_body:
33123312
ret void
33133313
}
33143314

3315+
; Test the interaction between wqm and llvm.amdgcn.init.exec.
3316+
define amdgpu_gs void @wqm_init_exec() {
3317+
; GFX9-W64-LABEL: wqm_init_exec:
3318+
; GFX9-W64: ; %bb.0: ; %bb
3319+
; GFX9-W64-NEXT: s_mov_b64 exec, -1
3320+
; GFX9-W64-NEXT: s_mov_b32 s0, 0
3321+
; GFX9-W64-NEXT: v_mov_b32_e32 v0, 0
3322+
; GFX9-W64-NEXT: s_mov_b32 s1, s0
3323+
; GFX9-W64-NEXT: s_mov_b32 s2, s0
3324+
; GFX9-W64-NEXT: s_mov_b32 s3, s0
3325+
; GFX9-W64-NEXT: v_mov_b32_e32 v1, v0
3326+
; GFX9-W64-NEXT: v_mov_b32_e32 v2, v0
3327+
; GFX9-W64-NEXT: v_mov_b32_e32 v3, v0
3328+
; GFX9-W64-NEXT: buffer_store_dwordx4 v[0:3], off, s[0:3], 0
3329+
; GFX9-W64-NEXT: s_wqm_b64 exec, exec
3330+
; GFX9-W64-NEXT: ; kill: def $sgpr0 killed $sgpr0 killed $exec
3331+
; GFX9-W64-NEXT: v_mov_b32_e32 v1, s0
3332+
; GFX9-W64-NEXT: ds_write_b32 v0, v1
3333+
; GFX9-W64-NEXT: s_endpgm
3334+
;
3335+
; GFX10-W32-LABEL: wqm_init_exec:
3336+
; GFX10-W32: ; %bb.0: ; %bb
3337+
; GFX10-W32-NEXT: s_mov_b32 s1, exec_lo
3338+
; GFX10-W32-NEXT: s_mov_b32 exec_lo, -1
3339+
; GFX10-W32-NEXT: v_mov_b32_e32 v0, 0
3340+
; GFX10-W32-NEXT: s_mov_b32 s0, 0
3341+
; GFX10-W32-NEXT: s_wqm_b32 exec_lo, exec_lo
3342+
; GFX10-W32-NEXT: s_mov_b32 s2, s0
3343+
; GFX10-W32-NEXT: s_and_b32 exec_lo, exec_lo, s1
3344+
; GFX10-W32-NEXT: v_mov_b32_e32 v1, v0
3345+
; GFX10-W32-NEXT: v_mov_b32_e32 v2, v0
3346+
; GFX10-W32-NEXT: v_mov_b32_e32 v3, v0
3347+
; GFX10-W32-NEXT: v_mov_b32_e32 v4, s0
3348+
; GFX10-W32-NEXT: s_mov_b32 s1, s0
3349+
; GFX10-W32-NEXT: s_mov_b32 s3, s0
3350+
; GFX10-W32-NEXT: buffer_store_dwordx4 v[0:3], off, s[0:3], 0
3351+
; GFX10-W32-NEXT: ds_write_b32 v0, v4
3352+
; GFX10-W32-NEXT: s_endpgm
3353+
bb:
3354+
call void @llvm.amdgcn.init.exec(i64 -1)
3355+
call void @llvm.amdgcn.raw.buffer.store.v4f32(<4 x float> zeroinitializer, <4 x i32> zeroinitializer, i32 0, i32 0, i32 0)
3356+
%i = call i32 @llvm.amdgcn.wqm.i32(i32 0)
3357+
store i32 %i, i32 addrspace(3)* null, align 4
3358+
ret void
3359+
}
3360+
33153361
declare void @llvm.amdgcn.exp.f32(i32, i32, float, float, float, float, i1, i1) #1
33163362
declare void @llvm.amdgcn.image.store.1d.v4f32.i32(<4 x float>, i32, i32, <8 x i32>, i32, i32) #1
33173363

0 commit comments

Comments
 (0)