Skip to content

Commit 4c4908c

Browse files
authored
[AMDGPU] adjust tests to prevent fpclass bitcast folding (#106268)
Make some minor tweaks to AMDGPU tests to ensure they still work as intended after #97762. These tests can be radically simplified after bitcast aware fpclass deduction.
1 parent 4d7a0ab commit 4c4908c

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

llvm/test/CodeGen/AMDGPU/anyext.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ define amdgpu_kernel void @anyext_v2i16_to_v2i32() #0 {
152152
; GCN-NEXT: s_mov_b32 s2, -1
153153
; GCN-NEXT: buffer_load_ushort v0, off, s[0:3], 0
154154
; GCN-NEXT: s_waitcnt vmcnt(0)
155-
; GCN-NEXT: v_and_b32_e32 v0, 0x8000, v0
155+
; GCN-NEXT: v_and_b32_e32 v0, 0x8001, v0
156156
; GCN-NEXT: v_lshlrev_b32_e32 v0, 16, v0
157157
; GCN-NEXT: v_cmp_eq_f32_e32 vcc, 0, v0
158158
; GCN-NEXT: v_cndmask_b32_e64 v0, 0, 1, vcc
@@ -164,7 +164,7 @@ define amdgpu_kernel void @anyext_v2i16_to_v2i32() #0 {
164164
; GFX8-NEXT: s_mov_b32 s3, 0xf000
165165
; GFX8-NEXT: s_mov_b32 s2, -1
166166
; GFX8-NEXT: buffer_load_ushort v0, off, s[0:3], 0
167-
; GFX8-NEXT: v_mov_b32_e32 v1, 0x8000
167+
; GFX8-NEXT: v_mov_b32_e32 v1, 0x8001
168168
; GFX8-NEXT: s_waitcnt vmcnt(0)
169169
; GFX8-NEXT: v_and_b32_sdwa v0, v0, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
170170
; GFX8-NEXT: v_cmp_eq_f32_e32 vcc, 0, v0
@@ -179,7 +179,7 @@ define amdgpu_kernel void @anyext_v2i16_to_v2i32() #0 {
179179
; GFX9-NEXT: s_mov_b32 s3, 0xf000
180180
; GFX9-NEXT: s_mov_b32 s2, -1
181181
; GFX9-NEXT: s_waitcnt vmcnt(0)
182-
; GFX9-NEXT: v_and_b32_e32 v0, 0x80008000, v0
182+
; GFX9-NEXT: v_and_b32_e32 v0, 0x80018001, v0
183183
; GFX9-NEXT: v_bfi_b32 v0, v1, 0, v0
184184
; GFX9-NEXT: v_cmp_eq_f32_e32 vcc, 0, v0
185185
; GFX9-NEXT: v_cndmask_b32_e64 v0, 0, 1, vcc
@@ -188,7 +188,7 @@ define amdgpu_kernel void @anyext_v2i16_to_v2i32() #0 {
188188
bb:
189189
%tmp = load i16, ptr addrspace(1) undef, align 2
190190
%tmp2 = insertelement <2 x i16> undef, i16 %tmp, i32 1
191-
%tmp4 = and <2 x i16> %tmp2, <i16 -32768, i16 -32768>
191+
%tmp4 = and <2 x i16> %tmp2, <i16 -32767, i16 -32767>
192192
%tmp5 = zext <2 x i16> %tmp4 to <2 x i32>
193193
%tmp6 = shl nuw <2 x i32> %tmp5, <i32 16, i32 16>
194194
%tmp7 = or <2 x i32> zeroinitializer, %tmp6

llvm/test/CodeGen/AMDGPU/fneg-modifier-casting.ll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,10 +1553,10 @@ define amdgpu_kernel void @fnge_select_f32_multi_use_regression(float %.i2369) {
15531553
; GCN-NEXT: s_waitcnt lgkmcnt(0)
15541554
; GCN-NEXT: v_cmp_nlt_f32_e64 s[0:1], s0, 0
15551555
; GCN-NEXT: v_cndmask_b32_e64 v0, 0, 1, s[0:1]
1556-
; GCN-NEXT: v_cmp_ngt_f32_e32 vcc, 0, v0
1556+
; GCN-NEXT: v_cmp_nge_f32_e32 vcc, 0, v0
15571557
; GCN-NEXT: v_cndmask_b32_e32 v1, 0, v0, vcc
15581558
; GCN-NEXT: v_mul_f32_e64 v0, -v0, v1
1559-
; GCN-NEXT: v_cmp_lt_f32_e32 vcc, 0, v0
1559+
; GCN-NEXT: v_cmp_le_f32_e32 vcc, 0, v0
15601560
; GCN-NEXT: s_and_b64 vcc, exec, vcc
15611561
; GCN-NEXT: s_endpgm
15621562
;
@@ -1567,23 +1567,23 @@ define amdgpu_kernel void @fnge_select_f32_multi_use_regression(float %.i2369) {
15671567
; GFX11-NEXT: v_cmp_nlt_f32_e64 s0, s0, 0
15681568
; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
15691569
; GFX11-NEXT: v_cndmask_b32_e64 v0, 0, 1, s0
1570-
; GFX11-NEXT: v_cmp_ngt_f32_e32 vcc_lo, 0, v0
1570+
; GFX11-NEXT: v_cmp_nge_f32_e32 vcc_lo, 0, v0
15711571
; GFX11-NEXT: v_cndmask_b32_e32 v1, 0, v0, vcc_lo
15721572
; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
15731573
; GFX11-NEXT: v_mul_f32_e64 v0, -v0, v1
1574-
; GFX11-NEXT: v_cmp_lt_f32_e32 vcc_lo, 0, v0
1574+
; GFX11-NEXT: v_cmp_le_f32_e32 vcc_lo, 0, v0
15751575
; GFX11-NEXT: s_and_b32 vcc_lo, exec_lo, vcc_lo
15761576
; GFX11-NEXT: s_endpgm
15771577
.entry:
15781578
%i = fcmp uge float %.i2369, 0.000000e+00
15791579
%.i2379 = select i1 %i, i32 1, i32 0
15801580
%.i0436 = bitcast i32 %.i2379 to float
15811581
%.i0440 = fneg float %.i0436
1582-
%i1 = fcmp uge float %.i0436, 0.000000e+00
1582+
%i1 = fcmp ugt float %.i0436, 0.000000e+00
15831583
%.i2495 = select i1 %i1, i32 %.i2379, i32 0
15841584
%.i0552 = bitcast i32 %.i2495 to float
15851585
%.i0592 = fmul float %.i0440, %.i0552
1586-
%.i0721 = fcmp ogt float %.i0592, 0.000000e+00
1586+
%.i0721 = fcmp oge float %.i0592, 0.000000e+00
15871587
br i1 %.i0721, label %bb5, label %bb
15881588

15891589
bb: ; preds = %.entry

0 commit comments

Comments
 (0)