1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -amdgpu-enable-delay-alu=0 -global-isel=1 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX11 %s
3 ; RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -amdgpu-enable-delay-alu=0 -global-isel=0 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX11 %s
5 declare i32 @llvm.amdgcn.s.wqm.i32(i32)
6 declare i64 @llvm.amdgcn.s.wqm.i64(i64)
8 define i32 @test_s_wqm_constant_i32() {
9 ; GFX11-LABEL: test_s_wqm_constant_i32:
11 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
12 ; GFX11-NEXT: v_mov_b32_e32 v0, 0xff00ff0f
13 ; GFX11-NEXT: s_setpc_b64 s[30:31]
14 %br = call i32 @llvm.amdgcn.s.wqm.i32(i32 u0x85003A02)
18 define i32 @test_s_wqm_constant_zero_i32() {
19 ; GFX11-LABEL: test_s_wqm_constant_zero_i32:
21 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
22 ; GFX11-NEXT: v_mov_b32_e32 v0, 0
23 ; GFX11-NEXT: s_setpc_b64 s[30:31]
24 %br = call i32 @llvm.amdgcn.s.wqm.i32(i32 0)
28 define i32 @test_s_wqm_constant_neg_one_i32() {
29 ; GFX11-LABEL: test_s_wqm_constant_neg_one_i32:
31 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
32 ; GFX11-NEXT: v_mov_b32_e32 v0, -1
33 ; GFX11-NEXT: s_setpc_b64 s[30:31]
34 %br = call i32 @llvm.amdgcn.s.wqm.i32(i32 -1)
38 define i32 @test_s_wqm_constant_undef_i32() {
39 ; GFX11-LABEL: test_s_wqm_constant_undef_i32:
41 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
42 ; GFX11-NEXT: s_wqm_b32 s0, s0
43 ; GFX11-NEXT: v_mov_b32_e32 v0, s0
44 ; GFX11-NEXT: s_setpc_b64 s[30:31]
45 %br = call i32 @llvm.amdgcn.s.wqm.i32(i32 undef)
49 define i32 @test_s_wqm_constant_poison_i32() {
50 ; GFX11-LABEL: test_s_wqm_constant_poison_i32:
52 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
53 ; GFX11-NEXT: s_wqm_b32 s0, s0
54 ; GFX11-NEXT: v_mov_b32_e32 v0, s0
55 ; GFX11-NEXT: s_setpc_b64 s[30:31]
56 %br = call i32 @llvm.amdgcn.s.wqm.i32(i32 poison)
61 define amdgpu_cs void @test_s_wqm_sgpr_i32(i32 inreg %mask, ptr addrspace(1) %out) {
62 ; GFX11-LABEL: test_s_wqm_sgpr_i32:
63 ; GFX11: ; %bb.0: ; %entry
64 ; GFX11-NEXT: s_wqm_b32 s0, s0
65 ; GFX11-NEXT: v_mov_b32_e32 v2, s0
66 ; GFX11-NEXT: global_store_b32 v[0:1], v2, off
67 ; GFX11-NEXT: s_endpgm
69 %br = call i32 @llvm.amdgcn.s.wqm.i32(i32 %mask)
70 store i32 %br, ptr addrspace(1) %out
74 define i32 @test_s_wqm_vgpr_i32(i32 %mask) {
75 ; GFX11-LABEL: test_s_wqm_vgpr_i32:
76 ; GFX11: ; %bb.0: ; %entry
77 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
78 ; GFX11-NEXT: v_readfirstlane_b32 s0, v0
79 ; GFX11-NEXT: s_wqm_b32 s0, s0
80 ; GFX11-NEXT: v_mov_b32_e32 v0, s0
81 ; GFX11-NEXT: s_setpc_b64 s[30:31]
83 %br = call i32 @llvm.amdgcn.s.wqm.i32(i32 %mask)
87 define i64 @test_s_wqm_constant_i64() {
88 ; GFX11-LABEL: test_s_wqm_constant_i64:
90 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
91 ; GFX11-NEXT: v_mov_b32_e32 v0, 0xff00ffff
92 ; GFX11-NEXT: v_mov_b32_e32 v1, 0xffff0fff
93 ; GFX11-NEXT: s_setpc_b64 s[30:31]
94 %br = call i64 @llvm.amdgcn.s.wqm.i64(i64 u0x12480FDBAC00753E)
98 define i64 @test_s_wqm_constant_zero_i64() {
99 ; GFX11-LABEL: test_s_wqm_constant_zero_i64:
101 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
102 ; GFX11-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0
103 ; GFX11-NEXT: s_setpc_b64 s[30:31]
104 %br = call i64 @llvm.amdgcn.s.wqm.i64(i64 0)
108 define i64 @test_s_wqm_constant_neg_one_i64() {
109 ; GFX11-LABEL: test_s_wqm_constant_neg_one_i64:
111 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
112 ; GFX11-NEXT: v_dual_mov_b32 v0, -1 :: v_dual_mov_b32 v1, -1
113 ; GFX11-NEXT: s_setpc_b64 s[30:31]
114 %br = call i64 @llvm.amdgcn.s.wqm.i64(i64 -1)
118 define i64 @test_s_wqm_constant_undef_i64() {
119 ; GFX11-LABEL: test_s_wqm_constant_undef_i64:
121 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
122 ; GFX11-NEXT: s_wqm_b64 s[0:1], s[0:1]
123 ; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
124 ; GFX11-NEXT: s_setpc_b64 s[30:31]
125 %br = call i64 @llvm.amdgcn.s.wqm.i64(i64 undef)
129 define i64 @test_s_wqm_constant_poison_i64() {
130 ; GFX11-LABEL: test_s_wqm_constant_poison_i64:
132 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
133 ; GFX11-NEXT: s_wqm_b64 s[0:1], s[0:1]
134 ; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
135 ; GFX11-NEXT: s_setpc_b64 s[30:31]
136 %br = call i64 @llvm.amdgcn.s.wqm.i64(i64 poison)
140 define amdgpu_cs void @test_s_wqm_sgpr_i64(i64 inreg %mask, ptr addrspace(1) %out) {
141 ; GFX11-LABEL: test_s_wqm_sgpr_i64:
142 ; GFX11: ; %bb.0: ; %entry
143 ; GFX11-NEXT: s_wqm_b64 s[0:1], s[0:1]
144 ; GFX11-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
145 ; GFX11-NEXT: global_store_b64 v[0:1], v[2:3], off
146 ; GFX11-NEXT: s_endpgm
148 %br = call i64 @llvm.amdgcn.s.wqm.i64(i64 %mask)
149 store i64 %br, ptr addrspace(1) %out
153 define i64 @test_s_wqm_vgpr_i64(i64 %mask) {
154 ; GFX11-LABEL: test_s_wqm_vgpr_i64:
155 ; GFX11: ; %bb.0: ; %entry
156 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
157 ; GFX11-NEXT: v_readfirstlane_b32 s0, v0
158 ; GFX11-NEXT: v_readfirstlane_b32 s1, v1
159 ; GFX11-NEXT: s_wqm_b64 s[0:1], s[0:1]
160 ; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
161 ; GFX11-NEXT: s_setpc_b64 s[30:31]
163 %br = call i64 @llvm.amdgcn.s.wqm.i64(i64 %mask)