Skip to content

Commit 515bd40

Browse files
committed
[RISCV] Fix test using wrong variable. NFC
Looks like this test was trying to check if two shifts were combined, but it was accidentally using the insertelement instead of the splat.
1 parent eea8874 commit 515bd40

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

llvm/test/CodeGen/RISCV/rvv/combine-splats.ll

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,15 @@ define <vscale x 2 x i64> @or_and_nxv2i64_fold(<vscale x 2 x i64> %a0) {
5959
define <vscale x 4 x i32> @combine_vec_shl_shl(<vscale x 4 x i32> %x) {
6060
; CHECK-LABEL: combine_vec_shl_shl:
6161
; CHECK: # %bb.0:
62-
; CHECK-NEXT: li a0, 2
63-
; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, ma
64-
; CHECK-NEXT: vmv.s.x v10, a0
65-
; CHECK-NEXT: li a0, 4
66-
; CHECK-NEXT: vmv.s.x v12, a0
67-
; CHECK-NEXT: vsll.vv v8, v8, v10
68-
; CHECK-NEXT: vsll.vv v8, v8, v12
62+
; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
63+
; CHECK-NEXT: vsll.vi v8, v8, 6
6964
; CHECK-NEXT: ret
7065
%ins1 = insertelement <vscale x 4 x i32> poison, i32 2, i32 0
7166
%splat1 = shufflevector <vscale x 4 x i32> %ins1, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
7267
%ins2 = insertelement <vscale x 4 x i32> poison, i32 4, i32 0
7368
%splat2 = shufflevector <vscale x 4 x i32> %ins2, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
74-
%v1 = shl <vscale x 4 x i32> %x, %ins1
75-
%v2 = shl <vscale x 4 x i32> %v1, %ins2
69+
%v1 = shl <vscale x 4 x i32> %x, %splat1
70+
%v2 = shl <vscale x 4 x i32> %v1, %splat2
7671
ret <vscale x 4 x i32> %v2
7772
}
7873

0 commit comments

Comments
 (0)