@@ -3395,6 +3395,52 @@ main_body:
3395
3395
ret void
3396
3396
}
3397
3397
3398
+ ; Test the interaction between wqm and llvm.amdgcn.init.exec.
3399
+ define amdgpu_gs void @wqm_init_exec () {
3400
+ ; GFX9-W64-LABEL: wqm_init_exec:
3401
+ ; GFX9-W64: ; %bb.0: ; %bb
3402
+ ; GFX9-W64-NEXT: s_mov_b64 exec, -1
3403
+ ; GFX9-W64-NEXT: s_mov_b32 s0, 0
3404
+ ; GFX9-W64-NEXT: v_mov_b32_e32 v0, 0
3405
+ ; GFX9-W64-NEXT: s_mov_b32 s1, s0
3406
+ ; GFX9-W64-NEXT: s_mov_b32 s2, s0
3407
+ ; GFX9-W64-NEXT: s_mov_b32 s3, s0
3408
+ ; GFX9-W64-NEXT: v_mov_b32_e32 v1, v0
3409
+ ; GFX9-W64-NEXT: v_mov_b32_e32 v2, v0
3410
+ ; GFX9-W64-NEXT: v_mov_b32_e32 v3, v0
3411
+ ; GFX9-W64-NEXT: buffer_store_dwordx4 v[0:3], off, s[0:3], 0
3412
+ ; GFX9-W64-NEXT: s_wqm_b64 exec, exec
3413
+ ; GFX9-W64-NEXT: ; kill: def $sgpr0 killed $sgpr0 killed $exec
3414
+ ; GFX9-W64-NEXT: v_mov_b32_e32 v1, s0
3415
+ ; GFX9-W64-NEXT: ds_write_b32 v0, v1
3416
+ ; GFX9-W64-NEXT: s_endpgm
3417
+ ;
3418
+ ; GFX10-W32-LABEL: wqm_init_exec:
3419
+ ; GFX10-W32: ; %bb.0: ; %bb
3420
+ ; GFX10-W32-NEXT: s_mov_b32 s1, exec_lo
3421
+ ; GFX10-W32-NEXT: s_mov_b32 exec_lo, -1
3422
+ ; GFX10-W32-NEXT: v_mov_b32_e32 v0, 0
3423
+ ; GFX10-W32-NEXT: s_mov_b32 s0, 0
3424
+ ; GFX10-W32-NEXT: s_wqm_b32 exec_lo, exec_lo
3425
+ ; GFX10-W32-NEXT: s_mov_b32 s2, s0
3426
+ ; GFX10-W32-NEXT: s_and_b32 exec_lo, exec_lo, s1
3427
+ ; GFX10-W32-NEXT: v_mov_b32_e32 v1, v0
3428
+ ; GFX10-W32-NEXT: v_mov_b32_e32 v2, v0
3429
+ ; GFX10-W32-NEXT: v_mov_b32_e32 v3, v0
3430
+ ; GFX10-W32-NEXT: v_mov_b32_e32 v4, s0
3431
+ ; GFX10-W32-NEXT: s_mov_b32 s1, s0
3432
+ ; GFX10-W32-NEXT: s_mov_b32 s3, s0
3433
+ ; GFX10-W32-NEXT: buffer_store_dwordx4 v[0:3], off, s[0:3], 0
3434
+ ; GFX10-W32-NEXT: ds_write_b32 v0, v4
3435
+ ; GFX10-W32-NEXT: s_endpgm
3436
+ bb:
3437
+ call void @llvm.amdgcn.init.exec (i64 -1 )
3438
+ call void @llvm.amdgcn.raw.buffer.store.v4f32 (<4 x float > zeroinitializer , <4 x i32 > zeroinitializer , i32 0 , i32 0 , i32 0 )
3439
+ %i = call i32 @llvm.amdgcn.wqm.i32 (i32 0 )
3440
+ store i32 %i , i32 addrspace (3 )* null , align 4
3441
+ ret void
3442
+ }
3443
+
3398
3444
declare void @llvm.amdgcn.exp.f32 (i32 , i32 , float , float , float , float , i1 , i1 ) #1
3399
3445
declare void @llvm.amdgcn.image.store.1d.v4f32.i32 (<4 x float >, i32 , i32 , <8 x i32 >, i32 , i32 ) #1
3400
3446
0 commit comments