Skip to content

Commit c182f40

Browse files
authored
AMDGPU: Replace <4 x i32> undef uses in tests with poison (#130902)
Most of these are from resource descriptors.
1 parent 6705d81 commit c182f40

26 files changed

+199
-199
lines changed

llvm/test/CodeGen/AMDGPU/adjust-writemask-invalid-copy.ll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
; GCN: buffer_store_dword v0
88
define amdgpu_ps void @adjust_writemask_crash_0_nochain() #0 {
99
main_body:
10-
%tmp = call <2 x float> @llvm.amdgcn.image.getlod.1d.v2f32.f32(i32 3, float undef, <8 x i32> undef, <4 x i32> undef, i1 0, i32 0, i32 0)
10+
%tmp = call <2 x float> @llvm.amdgcn.image.getlod.1d.v2f32.f32(i32 3, float undef, <8 x i32> undef, <4 x i32> poison, i1 0, i32 0, i32 0)
1111
%tmp1 = bitcast <2 x float> %tmp to <2 x i32>
1212
%tmp2 = shufflevector <2 x i32> %tmp1, <2 x i32> poison, <4 x i32> <i32 1, i32 poison, i32 poison, i32 poison>
1313
%tmp3 = bitcast <4 x i32> %tmp2 to <4 x float>
@@ -23,7 +23,7 @@ main_body:
2323
; GCN: buffer_store_dword v0
2424
define amdgpu_ps void @adjust_writemask_crash_1_nochain() #0 {
2525
main_body:
26-
%tmp = call <2 x float> @llvm.amdgcn.image.getlod.1d.v2f32.f32(i32 3, float undef, <8 x i32> undef, <4 x i32> undef, i1 0, i32 0, i32 0)
26+
%tmp = call <2 x float> @llvm.amdgcn.image.getlod.1d.v2f32.f32(i32 3, float undef, <8 x i32> undef, <4 x i32> poison, i1 0, i32 0, i32 0)
2727
%tmp1 = bitcast <2 x float> %tmp to <2 x i32>
2828
%tmp2 = shufflevector <2 x i32> %tmp1, <2 x i32> poison, <4 x i32> <i32 1, i32 0, i32 poison, i32 poison>
2929
%tmp3 = bitcast <4 x i32> %tmp2 to <4 x float>
@@ -39,7 +39,7 @@ main_body:
3939
; GCN: buffer_store_dword v0
4040
define amdgpu_ps void @adjust_writemask_crash_0_chain() #0 {
4141
main_body:
42-
%tmp = call <2 x float> @llvm.amdgcn.image.sample.1d.v2f32.f32(i32 3, float undef, <8 x i32> undef, <4 x i32> undef, i1 0, i32 0, i32 0)
42+
%tmp = call <2 x float> @llvm.amdgcn.image.sample.1d.v2f32.f32(i32 3, float undef, <8 x i32> undef, <4 x i32> poison, i1 0, i32 0, i32 0)
4343
%tmp1 = bitcast <2 x float> %tmp to <2 x i32>
4444
%tmp2 = shufflevector <2 x i32> %tmp1, <2 x i32> poison, <4 x i32> <i32 1, i32 poison, i32 poison, i32 poison>
4545
%tmp3 = bitcast <4 x i32> %tmp2 to <4 x float>
@@ -55,7 +55,7 @@ main_body:
5555
; GCN: buffer_store_dword v0
5656
define amdgpu_ps void @adjust_writemask_crash_1_chain() #0 {
5757
main_body:
58-
%tmp = call <2 x float> @llvm.amdgcn.image.sample.1d.v2f32.f32(i32 3, float undef, <8 x i32> undef, <4 x i32> undef, i1 0, i32 0, i32 0)
58+
%tmp = call <2 x float> @llvm.amdgcn.image.sample.1d.v2f32.f32(i32 3, float undef, <8 x i32> undef, <4 x i32> poison, i1 0, i32 0, i32 0)
5959
%tmp1 = bitcast <2 x float> %tmp to <2 x i32>
6060
%tmp2 = shufflevector <2 x i32> %tmp1, <2 x i32> poison, <4 x i32> <i32 1, i32 0, i32 poison, i32 poison>
6161
%tmp3 = bitcast <4 x i32> %tmp2 to <4 x float>
@@ -66,7 +66,7 @@ main_body:
6666

6767
define amdgpu_ps void @adjust_writemask_crash_0_v4() #0 {
6868
main_body:
69-
%tmp = call <4 x float> @llvm.amdgcn.image.getlod.1d.v4f32.f32(i32 5, float undef, <8 x i32> undef, <4 x i32> undef, i1 0, i32 0, i32 0)
69+
%tmp = call <4 x float> @llvm.amdgcn.image.getlod.1d.v4f32.f32(i32 5, float undef, <8 x i32> undef, <4 x i32> poison, i1 0, i32 0, i32 0)
7070
%tmp1 = bitcast <4 x float> %tmp to <4 x i32>
7171
%tmp2 = shufflevector <4 x i32> %tmp1, <4 x i32> poison, <4 x i32> <i32 1, i32 poison, i32 poison, i32 poison>
7272
%tmp3 = bitcast <4 x i32> %tmp2 to <4 x float>

llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ declare <4 x float> @llvm.amdgcn.s.buffer.load.v4f32(<4 x i32>, i32, i32 immarg)
293293
; CHECK-LABEL: {{^}}bitcast_v4f32_to_v2i64:
294294
; CHECK: s_buffer_load_{{dwordx4|b128}}
295295
define <2 x i64> @bitcast_v4f32_to_v2i64(<2 x i64> %arg) {
296-
%val = call <4 x float> @llvm.amdgcn.s.buffer.load.v4f32(<4 x i32> undef, i32 0, i32 0)
296+
%val = call <4 x float> @llvm.amdgcn.s.buffer.load.v4f32(<4 x i32> poison, i32 0, i32 0)
297297
%cast = bitcast <4 x float> %val to <2 x i64>
298298
%div = udiv <2 x i64> %cast, %arg
299299
ret <2 x i64> %div

llvm/test/CodeGen/AMDGPU/bug-vopc-commute.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
; of which were in SGPRs.
99
define amdgpu_vs float @main(i32 %v) {
1010
main_body:
11-
%d1 = call float @llvm.amdgcn.s.buffer.load.f32(<4 x i32> undef, i32 960, i32 0)
12-
%d2 = call float @llvm.amdgcn.s.buffer.load.f32(<4 x i32> undef, i32 976, i32 0)
11+
%d1 = call float @llvm.amdgcn.s.buffer.load.f32(<4 x i32> poison, i32 960, i32 0)
12+
%d2 = call float @llvm.amdgcn.s.buffer.load.f32(<4 x i32> poison, i32 976, i32 0)
1313
br i1 undef, label %ENDIF56, label %IF57
1414

1515
IF57: ; preds = %ENDIF

llvm/test/CodeGen/AMDGPU/dagcombine-fma-fmad.ll

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -143,32 +143,32 @@ define amdgpu_ps float @_amdgpu_ps_main() #0 {
143143
; GFX11-NEXT: v_max_f32_e32 v0, 0, v1
144144
; GFX11-NEXT: ; return to shader part epilog
145145
.entry:
146-
%0 = call <3 x float> @llvm.amdgcn.image.sample.2d.v3f32.f32(i32 7, float undef, float undef, <8 x i32> undef, <4 x i32> undef, i1 false, i32 0, i32 0)
146+
%0 = call <3 x float> @llvm.amdgcn.image.sample.2d.v3f32.f32(i32 7, float undef, float undef, <8 x i32> undef, <4 x i32> poison, i1 false, i32 0, i32 0)
147147
%.i2243 = extractelement <3 x float> %0, i32 2
148-
%1 = call <3 x i32> @llvm.amdgcn.s.buffer.load.v3i32(<4 x i32> undef, i32 0, i32 0)
148+
%1 = call <3 x i32> @llvm.amdgcn.s.buffer.load.v3i32(<4 x i32> poison, i32 0, i32 0)
149149
%2 = shufflevector <3 x i32> %1, <3 x i32> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
150150
%3 = bitcast <4 x i32> %2 to <4 x float>
151151
%.i2248 = extractelement <4 x float> %3, i32 2
152152
%.i2249 = fmul reassoc nnan nsz arcp contract afn float %.i2243, %.i2248
153153
%4 = call reassoc nnan nsz arcp contract afn float @llvm.amdgcn.fmed3.f32(float undef, float 0.000000e+00, float 1.000000e+00)
154-
%5 = call <3 x float> @llvm.amdgcn.image.sample.2d.v3f32.f32(i32 7, float undef, float undef, <8 x i32> undef, <4 x i32> undef, i1 false, i32 0, i32 0)
154+
%5 = call <3 x float> @llvm.amdgcn.image.sample.2d.v3f32.f32(i32 7, float undef, float undef, <8 x i32> undef, <4 x i32> poison, i1 false, i32 0, i32 0)
155155
%.i2333 = extractelement <3 x float> %5, i32 2
156156
%6 = call reassoc nnan nsz arcp contract afn float @llvm.amdgcn.fmed3.f32(float undef, float 0.000000e+00, float 1.000000e+00)
157-
%7 = call <2 x float> @llvm.amdgcn.image.sample.2d.v2f32.f32(i32 3, float undef, float undef, <8 x i32> undef, <4 x i32> undef, i1 false, i32 0, i32 0)
157+
%7 = call <2 x float> @llvm.amdgcn.image.sample.2d.v2f32.f32(i32 3, float undef, float undef, <8 x i32> undef, <4 x i32> poison, i1 false, i32 0, i32 0)
158158
%.i1408 = extractelement <2 x float> %7, i32 1
159159
%.i0364 = extractelement <2 x float> %7, i32 0
160-
%8 = call float @llvm.amdgcn.image.sample.2d.f32.f32(i32 1, float undef, float undef, <8 x i32> undef, <4 x i32> undef, i1 false, i32 0, i32 0)
161-
%9 = call <3 x i32> @llvm.amdgcn.s.buffer.load.v3i32(<4 x i32> undef, i32 112, i32 0)
160+
%8 = call float @llvm.amdgcn.image.sample.2d.f32.f32(i32 1, float undef, float undef, <8 x i32> undef, <4 x i32> poison, i1 false, i32 0, i32 0)
161+
%9 = call <3 x i32> @llvm.amdgcn.s.buffer.load.v3i32(<4 x i32> poison, i32 112, i32 0)
162162
%10 = shufflevector <3 x i32> %9, <3 x i32> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
163163
%11 = bitcast <4 x i32> %10 to <4 x float>
164164
%.i2360 = extractelement <4 x float> %11, i32 2
165165
%.i2363 = fmul reassoc nnan nsz arcp contract afn float %.i2360, %8
166-
%12 = call <3 x i32> @llvm.amdgcn.s.buffer.load.v3i32(<4 x i32> undef, i32 96, i32 0)
166+
%12 = call <3 x i32> @llvm.amdgcn.s.buffer.load.v3i32(<4 x i32> poison, i32 96, i32 0)
167167
%13 = shufflevector <3 x i32> %12, <3 x i32> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
168168
%14 = bitcast <4 x i32> %13 to <4 x float>
169169
%.i2367 = extractelement <4 x float> %14, i32 2
170170
%.i2370 = fmul reassoc nnan nsz arcp contract afn float %.i0364, %.i2367
171-
%15 = call <3 x i32> @llvm.amdgcn.s.buffer.load.v3i32(<4 x i32> undef, i32 32, i32 0)
171+
%15 = call <3 x i32> @llvm.amdgcn.s.buffer.load.v3i32(<4 x i32> poison, i32 32, i32 0)
172172
%16 = shufflevector <3 x i32> %15, <3 x i32> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
173173
%17 = bitcast <4 x i32> %16 to <4 x float>
174174
%.i2373 = extractelement <4 x float> %17, i32 2
@@ -181,19 +181,19 @@ define amdgpu_ps float @_amdgpu_ps_main() #0 {
181181
%.i2397 = fmul reassoc nnan nsz arcp contract afn float %.i2363, %18
182182
%.i2404 = fmul reassoc nnan nsz arcp contract afn float %.i2394, %4
183183
%.i2407 = fadd reassoc nnan nsz arcp contract afn float %.i2397, %.i2404
184-
%20 = call i32 @llvm.amdgcn.s.buffer.load.i32(<4 x i32> undef, i32 92, i32 0)
184+
%20 = call i32 @llvm.amdgcn.s.buffer.load.i32(<4 x i32> poison, i32 92, i32 0)
185185
%21 = bitcast i32 %20 to float
186-
%22 = call i32 @llvm.amdgcn.s.buffer.load.i32(<4 x i32> undef, i32 124, i32 0)
186+
%22 = call i32 @llvm.amdgcn.s.buffer.load.i32(<4 x i32> poison, i32 124, i32 0)
187187
%23 = bitcast i32 %22 to float
188188
%24 = fsub reassoc nnan nsz arcp contract afn float %21, %23
189189
%25 = fmul reassoc nnan nsz arcp contract afn float %.i1408, %24
190190
%26 = fadd reassoc nnan nsz arcp contract afn float %25, %23
191-
%27 = call i32 @llvm.amdgcn.s.buffer.load.i32(<4 x i32> undef, i32 44, i32 0)
191+
%27 = call i32 @llvm.amdgcn.s.buffer.load.i32(<4 x i32> poison, i32 44, i32 0)
192192
%28 = bitcast i32 %27 to float
193193
%29 = fsub reassoc nnan nsz arcp contract afn float %28, %26
194194
%30 = fmul reassoc nnan nsz arcp contract afn float %6, %29
195195
%31 = fadd reassoc nnan nsz arcp contract afn float %26, %30
196-
%32 = call i32 @llvm.amdgcn.s.buffer.load.i32(<4 x i32> undef, i32 192, i32 0)
196+
%32 = call i32 @llvm.amdgcn.s.buffer.load.i32(<4 x i32> poison, i32 192, i32 0)
197197
%33 = bitcast i32 %32 to float
198198
%34 = fadd reassoc nnan nsz arcp contract afn float %33, -1.000000e+00
199199
%35 = fmul reassoc nnan nsz arcp contract afn float %18, %34
@@ -207,29 +207,29 @@ define amdgpu_ps float @_amdgpu_ps_main() #0 {
207207
%42 = call <3 x float> @llvm.amdgcn.image.load.mip.2d.v3f32.i32(i32 7, i32 undef, i32 undef, i32 0, <8 x i32> undef, i32 0, i32 0)
208208
%.i2521 = extractelement <3 x float> %42, i32 2
209209
%43 = call reassoc nnan nsz arcp contract afn float @llvm.amdgcn.fmed3.f32(float undef, float 0.000000e+00, float 1.000000e+00)
210-
%44 = call <3 x float> @llvm.amdgcn.image.sample.2d.v3f32.f32(i32 7, float undef, float undef, <8 x i32> undef, <4 x i32> undef, i1 false, i32 0, i32 0)
210+
%44 = call <3 x float> @llvm.amdgcn.image.sample.2d.v3f32.f32(i32 7, float undef, float undef, <8 x i32> undef, <4 x i32> poison, i1 false, i32 0, i32 0)
211211
%.i2465 = extractelement <3 x float> %44, i32 2
212212
%.i2466 = fmul reassoc nnan nsz arcp contract afn float %.i2465, %43
213213
%.i2469 = fmul reassoc nnan nsz arcp contract afn float %.i2415, %.i2466
214-
%45 = call <3 x i32> @llvm.amdgcn.s.buffer.load.v3i32(<4 x i32> undef, i32 64, i32 0)
214+
%45 = call <3 x i32> @llvm.amdgcn.s.buffer.load.v3i32(<4 x i32> poison, i32 64, i32 0)
215215
%46 = shufflevector <3 x i32> %45, <3 x i32> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
216216
%47 = bitcast <4 x i32> %46 to <4 x float>
217217
%.i2476 = extractelement <4 x float> %47, i32 2
218218
%.i2479 = fmul reassoc nnan nsz arcp contract afn float %.i2476, %18
219-
%48 = call <3 x i32> @llvm.amdgcn.s.buffer.load.v3i32(<4 x i32> undef, i32 80, i32 0)
219+
%48 = call <3 x i32> @llvm.amdgcn.s.buffer.load.v3i32(<4 x i32> poison, i32 80, i32 0)
220220
%49 = shufflevector <3 x i32> %48, <3 x i32> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
221221
%50 = bitcast <4 x i32> %49 to <4 x float>
222222
%.i2482 = extractelement <4 x float> %50, i32 2
223223
%.i2485 = fsub reassoc nnan nsz arcp contract afn float %.i2482, %.i2479
224224
%.i2488 = fmul reassoc nnan nsz arcp contract afn float %.i2249, %18
225225
%.i2491 = fmul reassoc nnan nsz arcp contract afn float %.i2485, %4
226226
%.i2494 = fadd reassoc nnan nsz arcp contract afn float %.i2479, %.i2491
227-
%51 = call <3 x float> @llvm.amdgcn.image.sample.2d.v3f32.f32(i32 7, float undef, float undef, <8 x i32> undef, <4 x i32> undef, i1 false, i32 0, i32 0)
227+
%51 = call <3 x float> @llvm.amdgcn.image.sample.2d.v3f32.f32(i32 7, float undef, float undef, <8 x i32> undef, <4 x i32> poison, i1 false, i32 0, i32 0)
228228
%.i2515 = extractelement <3 x float> %51, i32 2
229229
%.i2516 = fadd reassoc nnan nsz arcp contract afn float %.i2515, %.i2494
230230
%.i2522 = fadd reassoc nnan nsz arcp contract afn float %.i2521, %.i2516
231231
%.i2525 = fmul reassoc nnan nsz arcp contract afn float %.i2522, %43
232-
%52 = call <3 x i32> @llvm.amdgcn.s.buffer.load.v3i32(<4 x i32> undef, i32 16, i32 0)
232+
%52 = call <3 x i32> @llvm.amdgcn.s.buffer.load.v3i32(<4 x i32> poison, i32 16, i32 0)
233233
%53 = shufflevector <3 x i32> %52, <3 x i32> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
234234
%54 = bitcast <4 x i32> %53 to <4 x float>
235235
%.i2530 = extractelement <4 x float> %54, i32 2

llvm/test/CodeGen/AMDGPU/else.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ if:
4141

4242
else:
4343
%c = fmul float %v, 3.0
44-
%tex = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %c, <8 x i32> undef, <4 x i32> undef, i1 0, i32 0, i32 0)
44+
%tex = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %c, <8 x i32> undef, <4 x i32> poison, i1 0, i32 0, i32 0)
4545
%v.else = extractelement <4 x float> %tex, i32 0
4646
br label %end
4747

llvm/test/CodeGen/AMDGPU/hsa-metadata-from-llvm-ir-full.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1781,7 +1781,7 @@ attributes #3 = { optnone noinline "amdgpu-no-completion-action" "amdgpu-no-defa
17811781
!4 = !{!""}
17821782
!5 = !{i32 undef, i32 1}
17831783
!6 = !{i32 1, i32 2, i32 4}
1784-
!7 = !{<4 x i32> undef, i32 0}
1784+
!7 = !{<4 x i32> poison, i32 0}
17851785
!8 = !{i32 8, i32 16, i32 32}
17861786
!9 = !{!"char"}
17871787
!10 = !{!"ushort2"}

llvm/test/CodeGen/AMDGPU/ipra-return-address-save-restore.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ sw.bb10:
185185
; GCN-DAG: v_readlane_b32 s30, [[CSR_VGPR]],
186186
; GCN: s_waitcnt vmcnt(0)
187187
; GCN: s_setpc_b64 s[30:31]
188-
call fastcc void @svm_node_closure_bsdf(ptr addrspace(1) null, ptr null, <4 x i32> zeroinitializer, ptr null, i32 undef, i8 undef, float undef, float undef, float undef, i1 undef, <4 x i32> undef, float undef, i32 undef, i1 undef, i1 undef, i1 undef, float undef, ptr addrspace(1) poison, ptr addrspace(1) poison, ptr addrspace(1) poison, i1 undef, ptr addrspace(1) poison, i32 undef, i1 undef, i32 undef, i64 undef, i32 undef)
188+
call fastcc void @svm_node_closure_bsdf(ptr addrspace(1) null, ptr null, <4 x i32> zeroinitializer, ptr null, i32 undef, i8 undef, float undef, float undef, float undef, i1 undef, <4 x i32> poison, float undef, i32 undef, i1 undef, i1 undef, i1 undef, float undef, ptr addrspace(1) poison, ptr addrspace(1) poison, ptr addrspace(1) poison, i1 undef, ptr addrspace(1) poison, i32 undef, i1 undef, i32 undef, i64 undef, i32 undef)
189189
ret void
190190
}
191191

llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ps.live.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ define amdgpu_ps float @test2() #0 {
2828
%live = call i1 @llvm.amdgcn.ps.live()
2929
%live.32 = zext i1 %live to i32
3030
%live.32.bc = bitcast i32 %live.32 to float
31-
%t = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %live.32.bc, <8 x i32> undef, <4 x i32> undef, i1 0, i32 0, i32 0)
31+
%t = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %live.32.bc, <8 x i32> undef, <4 x i32> poison, i1 0, i32 0, i32 0)
3232
%r = extractelement <4 x float> %t, i32 0
3333
ret float %r
3434
}
@@ -51,7 +51,7 @@ dead:
5151
end:
5252
%tc = phi i32 [ %in, %entry ], [ %tc.dead, %dead ]
5353
%tc.bc = bitcast i32 %tc to float
54-
%t = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %tc.bc, <8 x i32> undef, <4 x i32> undef, i1 0, i32 0, i32 0) #0
54+
%t = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %tc.bc, <8 x i32> undef, <4 x i32> poison, i1 0, i32 0, i32 0) #0
5555
%r = extractelement <4 x float> %t, i32 0
5656
ret float %r
5757
}

llvm/test/CodeGen/AMDGPU/llvm.amdgcn.raw.buffer.atomic.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ main_body:
103103
;CHECK: buffer_atomic_add v0,
104104
define amdgpu_ps float @test4() {
105105
main_body:
106-
%v = call i32 @llvm.amdgcn.raw.buffer.atomic.add.i32(i32 1, <4 x i32> undef, i32 4, i32 0, i32 0)
106+
%v = call i32 @llvm.amdgcn.raw.buffer.atomic.add.i32(i32 1, <4 x i32> poison, i32 4, i32 0, i32 0)
107107
%v.float = bitcast i32 %v to float
108108
ret float %v.float
109109
}

0 commit comments

Comments
 (0)