Revert rGe6ccb57bb3f6b761f2310e97fd6ca99eff42f73e "[SLP] Add cost model for `llvm...
[llvm-project.git] / llvm / test / CodeGen / AMDGPU / wqm-gfx11.ll
blob35f77693b5e84b8d6ae9892781f0aba76a6ac6ea
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -march=amdgcn -mcpu=gfx1100 -verify-machineinstrs < %s | FileCheck -check-prefixes=CHECK %s
4 ; Test that s_wqm is executed before lds.param.load.
5 define amdgpu_ps <3 x float> @test_param_load(i32 inreg %attr, <3 x float> %to_add) {
6 ; CHECK-LABEL: test_param_load:
7 ; CHECK:       ; %bb.0: ; %main_body
8 ; CHECK-NEXT:    s_mov_b32 m0, s0
9 ; CHECK-NEXT:    s_mov_b32 s0, exec_lo
10 ; CHECK-NEXT:    s_wqm_b32 exec_lo, exec_lo
11 ; CHECK-NEXT:    lds_param_load v3, attr0.x wait_vdst:15
12 ; CHECK-NEXT:    lds_param_load v4, attr0.y wait_vdst:15
13 ; CHECK-NEXT:    lds_param_load v5, attr0.z wait_vdst:15
14 ; CHECK-NEXT:    s_mov_b32 exec_lo, s0
15 ; CHECK-NEXT:    s_waitcnt expcnt(2)
16 ; CHECK-NEXT:    v_add_f32_e32 v0, v3, v0
17 ; CHECK-NEXT:    s_waitcnt expcnt(1)
18 ; CHECK-NEXT:    v_add_f32_e32 v1, v4, v1
19 ; CHECK-NEXT:    s_waitcnt expcnt(0)
20 ; CHECK-NEXT:    v_add_f32_e32 v2, v5, v2
21 ; CHECK-NEXT:    ; return to shader part epilog
22 main_body:
23   %a = call float @llvm.amdgcn.lds.param.load(i32 immarg 0, i32 immarg 0, i32 %attr) #1
24   %b = call float @llvm.amdgcn.lds.param.load(i32 immarg 1, i32 immarg 0, i32 %attr) #1
25   %c = call float @llvm.amdgcn.lds.param.load(i32 immarg 2, i32 immarg 0, i32 %attr) #1
26   %tmp_0 = insertelement <3 x float> undef, float %a, i32 0
27   %tmp_1 = insertelement <3 x float> %tmp_0, float %b, i32 1
28   %tmp_2 = insertelement <3 x float> %tmp_1, float %c, i32 2
29   %res = fadd <3 x float> %tmp_2, %to_add
30   ret  <3 x float> %res
33 ; Test that s_wqm is executed before lds.direct.load.
34 define amdgpu_ps <3 x float> @test_direct_load(i32 inreg %arg_0, i32 inreg %arg_1, i32 inreg %arg_2, <3 x float> %to_add) {
35 ; CHECK-LABEL: test_direct_load:
36 ; CHECK:       ; %bb.0: ; %main_body
37 ; CHECK-NEXT:    s_mov_b32 m0, s0
38 ; CHECK-NEXT:    s_mov_b32 s0, exec_lo
39 ; CHECK-NEXT:    s_wqm_b32 exec_lo, exec_lo
40 ; CHECK-NEXT:    lds_direct_load v3 wait_vdst:15
41 ; CHECK-NEXT:    s_mov_b32 m0, s1
42 ; CHECK-NEXT:    lds_direct_load v4 wait_vdst:15
43 ; CHECK-NEXT:    s_mov_b32 m0, s2
44 ; CHECK-NEXT:    lds_direct_load v5 wait_vdst:15
45 ; CHECK-NEXT:    s_mov_b32 exec_lo, s0
46 ; CHECK-NEXT:    s_waitcnt expcnt(2)
47 ; CHECK-NEXT:    v_add_f32_e32 v0, v3, v0
48 ; CHECK-NEXT:    s_waitcnt expcnt(1)
49 ; CHECK-NEXT:    v_add_f32_e32 v1, v4, v1
50 ; CHECK-NEXT:    s_waitcnt expcnt(0)
51 ; CHECK-NEXT:    v_add_f32_e32 v2, v5, v2
52 ; CHECK-NEXT:    ; return to shader part epilog
53 main_body:
54   %a = call float @llvm.amdgcn.lds.direct.load(i32 %arg_0) #1
55   %b = call float @llvm.amdgcn.lds.direct.load(i32 %arg_1) #1
56   %c = call float @llvm.amdgcn.lds.direct.load(i32 %arg_2) #1
57   %tmp_0 = insertelement <3 x float> undef, float %a, i32 0
58   %tmp_1 = insertelement <3 x float> %tmp_0, float %b, i32 1
59   %tmp_2 = insertelement <3 x float> %tmp_1, float %c, i32 2
60   %res = fadd <3 x float> %tmp_2, %to_add
61   ret  <3 x float> %res
64 attributes #1 = { nounwind readnone speculatable willreturn }
65 declare float @llvm.amdgcn.lds.param.load(i32 immarg, i32 immarg, i32) #1
66 declare float @llvm.amdgcn.lds.direct.load(i32) #1