Skip to content

Commit 87b79d7

Browse files
committed
Add test that shows the VOPD regression
1 parent a59b07a commit 87b79d7

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

llvm/test/CodeGen/AMDGPU/bitreverse-inline-immediates.ll

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefixes=GCN,SI %s
22
; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefixes=GCN,VI %s
3+
; RUN: llc -march=amdgcn -mcpu=gfx1100 < %s | FileCheck -check-prefix=GFX11 %s
34

45
; Test that materialization constants that are the bit reversed of
56
; inline immediates are replaced with bfrev of the inline immediate to
@@ -278,3 +279,15 @@ define void @materialize_not_neg_inv2pi_i32(ptr addrspace(1) %out) {
278279
store i32 1105004156, ptr addrspace(1) %out
279280
ret void
280281
}
282+
283+
; One constant is reversible, the other is not. We shouldn't break
284+
; vopd packing for this.
285+
; GFX11-LABEL: {{^}}vopd_materialize:
286+
; FIXME-GFX11: v_dual_mov_b32 v0, 0x102 :: v_dual_mov_b32 v1, 1.0
287+
; GFX11: v_bfrev_b32_e32 v0, 4.0
288+
; GFX11: v_mov_b32_e32 v1, 1.0
289+
define <2 x i32> @vopd_materialize() {
290+
%insert0 = insertelement <2 x i32> poison, i32 258, i32 0
291+
%insert1 = insertelement <2 x i32> %insert0, i32 1065353216, i32 1
292+
ret <2 x i32> %insert1
293+
}

0 commit comments

Comments
 (0)