You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[RISCV Add some vsetvli insertion test cases with vmv.s.x+reduction. NFC (#75544)
These test cases where intended to get a single vsetvli by using the
vmv.s.x intrinsic with the same LMUL as the reduction. This works for
FP, but does not work for integer.
I believe #71501 will break this for FP too. Hopefully the vsetvli pass
can be taught to fix this.
define <vscale x 2 x float> @fp_reduction_vfmv_s_f(float%0, <vscale x 8 x float> %1, i64%2) {
631
+
; CHECK-LABEL: fp_reduction_vfmv_s_f:
632
+
; CHECK: # %bb.0:
633
+
; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
634
+
; CHECK-NEXT: vfmv.s.f v12, fa0
635
+
; CHECK-NEXT: vfredusum.vs v8, v8, v12
636
+
; CHECK-NEXT: ret
637
+
%4 = tailcall <vscale x 8 x float> @llvm.riscv.vfmv.s.f.nxv8f32.i64(<vscale x 8 x float> poison, float%0, i64%2)
638
+
%5 = tailcall <vscale x 2 x float> @llvm.vector.extract.nxv2f32.nxv8f32(<vscale x 8 x float> %4, i640)
639
+
%6 = tailcall <vscale x 2 x float> @llvm.riscv.vfredusum.nxv2f32.nxv8f32.i64(<vscale x 2 x float> poison, <vscale x 8 x float> %1, <vscale x 2 x float> %5, i647, i64%2)
640
+
ret <vscale x 2 x float> %6
641
+
}
642
+
643
+
define dso_local <vscale x 2 x i32> @int_reduction_vmv_s_x(i32signext%0, <vscale x 8 x i32> %1, i64%2) {
644
+
; CHECK-LABEL: int_reduction_vmv_s_x:
645
+
; CHECK: # %bb.0:
646
+
; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
647
+
; CHECK-NEXT: vmv.s.x v12, a0
648
+
; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
649
+
; CHECK-NEXT: vredsum.vs v8, v8, v12
650
+
; CHECK-NEXT: ret
651
+
%4 = tailcall <vscale x 8 x i32> @llvm.riscv.vmv.s.x.nxv8i32.i64(<vscale x 8 x i32> poison, i32%0, i64%2)
652
+
%5 = tailcall <vscale x 2 x i32> @llvm.vector.extract.nxv2i32.nxv8i32(<vscale x 8 x i32> %4, i640)
653
+
%6 = tailcall <vscale x 2 x i32> @llvm.riscv.vredsum.nxv2i32.nxv8i32.i64(<vscale x 2 x i32> poison, <vscale x 8 x i32> %1, <vscale x 2 x i32> %5, i64%2)
654
+
ret <vscale x 2 x i32> %6
655
+
}
656
+
657
+
declare <vscale x 8 x float> @llvm.riscv.vfmv.s.f.nxv8f32.i64(<vscale x 8 x float>, float, i64)
658
+
declare <vscale x 2 x float> @llvm.vector.extract.nxv2f32.nxv8f32(<vscale x 8 x float>, i64)
659
+
declare <vscale x 2 x float> @llvm.riscv.vfredusum.nxv2f32.nxv8f32.i64(<vscale x 2 x float>, <vscale x 8 x float>, <vscale x 2 x float>, i64, i64)
660
+
661
+
declare <vscale x 8 x i32> @llvm.riscv.vmv.s.x.nxv8i32.i64(<vscale x 8 x i32>, i32, i64) #1
662
+
declare <vscale x 2 x i32> @llvm.vector.extract.nxv2i32.nxv8i32(<vscale x 8 x i32>, i64 immarg) #2
663
+
declare <vscale x 2 x i32> @llvm.riscv.vredsum.nxv2i32.nxv8i32.i64(<vscale x 2 x i32>, <vscale x 8 x i32>, <vscale x 2 x i32>, i64) #1
664
+
630
665
declare <vscale x 1 x i64> @llvm.riscv.vadd.mask.nxv1i64.nxv1i64(
0 commit comments