Skip to content

Commit d407e6c

Browse files
committed
[RISCV] Add test to showcase miscompile from #79072
1 parent 731c204 commit d407e6c

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

llvm/test/CodeGen/RISCV/rvv/fixed-vectors-shuffle-exact-vlen.ll

+16-2
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ define <4 x i64> @m2_splat_two_source(<4 x i64> %v1, <4 x i64> %v2) vscale_range
138138
ret <4 x i64> %res
139139
}
140140

141-
define <4 x i64> @m2_splat_into_identity_two_source(<4 x i64> %v1, <4 x i64> %v2) vscale_range(2,2) {
142-
; CHECK-LABEL: m2_splat_into_identity_two_source:
141+
define <4 x i64> @m2_splat_into_identity_two_source_v2_hi(<4 x i64> %v1, <4 x i64> %v2) vscale_range(2,2) {
142+
; CHECK-LABEL: m2_splat_into_identity_two_source_v2_hi:
143143
; CHECK: # %bb.0:
144144
; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
145145
; CHECK-NEXT: vrgather.vi v10, v8, 0
@@ -149,6 +149,20 @@ define <4 x i64> @m2_splat_into_identity_two_source(<4 x i64> %v1, <4 x i64> %v2
149149
ret <4 x i64> %res
150150
}
151151

152+
; FIXME: This is a miscompile, we're clobbering the lower reg group of %v2
153+
; (v10), and the vmv1r.v is moving from the wrong reg group (should be v10)
154+
define <4 x i64> @m2_splat_into_slide_two_source_v2_lo(<4 x i64> %v1, <4 x i64> %v2) vscale_range(2,2) {
155+
; CHECK-LABEL: m2_splat_into_slide_two_source_v2_lo:
156+
; CHECK: # %bb.0:
157+
; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
158+
; CHECK-NEXT: vrgather.vi v10, v8, 0
159+
; CHECK-NEXT: vmv1r.v v11, v8
160+
; CHECK-NEXT: vmv2r.v v8, v10
161+
; CHECK-NEXT: ret
162+
%res = shufflevector <4 x i64> %v1, <4 x i64> %v2, <4 x i32> <i32 0, i32 0, i32 4, i32 5>
163+
ret <4 x i64> %res
164+
}
165+
152166
define <4 x i64> @m2_splat_into_slide_two_source(<4 x i64> %v1, <4 x i64> %v2) vscale_range(2,2) {
153167
; CHECK-LABEL: m2_splat_into_slide_two_source:
154168
; CHECK: # %bb.0:

0 commit comments

Comments
 (0)