Skip to content

Commit 2f06e88

Browse files
committed
Precommit tests
1 parent 0819fec commit 2f06e88

File tree

1 file changed

+91
-2
lines changed

1 file changed

+91
-2
lines changed

llvm/test/CodeGen/RISCV/rvv/vsetvli-insert.ll

Lines changed: 91 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2-
; RUN: llc -mtriple=riscv64 -mattr=+m,+f,+d,+a,+c,+v \
3-
; RUN: -target-abi=lp64d -verify-machineinstrs -O2 < %s | FileCheck %s
2+
; RUN: llc -mtriple=riscv64 -mattr=+m,+f,+d,+a,+c,+v -verify-machineinstrs -O2 < %s | FileCheck %s --check-prefixes=CHECK,NODEPVL
3+
; RUN: llc -mtriple=riscv64 -mattr=+m,+f,+d,+a,+c,+v,+vl-dependent-latency -verify-machineinstrs -O2 < %s | FileCheck %s --check-prefixes=CHECK,DEPVL
44

55
declare i64 @llvm.riscv.vsetvli(i64, i64, i64)
66
declare i64 @llvm.riscv.vsetvlimax(i64, i64)
@@ -753,3 +753,92 @@ while.body:
753753
while.end:
754754
ret i64 0
755755
}
756+
757+
define <vscale x 1 x i64> @vslideup_vl1(<vscale x 1 x i64> %a) nounwind {
758+
; CHECK-LABEL: vslideup_vl1:
759+
; CHECK: # %bb.0: # %entry
760+
; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
761+
; CHECK-NEXT: vslideup.vi v9, v8, 1
762+
; CHECK-NEXT: vadd.vv v8, v9, v9
763+
; CHECK-NEXT: ret
764+
entry:
765+
%1 = tail call <vscale x 1 x i64> @llvm.riscv.vslideup(
766+
<vscale x 1 x i64> poison,
767+
<vscale x 1 x i64> %a,
768+
i64 1,
769+
i64 1,
770+
i64 3)
771+
%2 = tail call <vscale x 1 x i64> @llvm.riscv.vadd(
772+
<vscale x 1 x i64> poison,
773+
<vscale x 1 x i64> %1,
774+
<vscale x 1 x i64> %1,
775+
i64 2)
776+
ret <vscale x 1 x i64> %2
777+
}
778+
779+
define <vscale x 1 x i64> @vslidedown_vl1(<vscale x 1 x i64> %a) nounwind {
780+
; CHECK-LABEL: vslidedown_vl1:
781+
; CHECK: # %bb.0: # %entry
782+
; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
783+
; CHECK-NEXT: vslidedown.vi v8, v8, 1
784+
; CHECK-NEXT: vadd.vv v8, v8, v8
785+
; CHECK-NEXT: ret
786+
entry:
787+
%1 = tail call <vscale x 1 x i64> @llvm.riscv.vslidedown(
788+
<vscale x 1 x i64> poison,
789+
<vscale x 1 x i64> %a,
790+
i64 1,
791+
i64 1,
792+
i64 3)
793+
%2 = tail call <vscale x 1 x i64> @llvm.riscv.vadd(
794+
<vscale x 1 x i64> poison,
795+
<vscale x 1 x i64> %1,
796+
<vscale x 1 x i64> %1,
797+
i64 2)
798+
ret <vscale x 1 x i64> %2
799+
}
800+
801+
802+
define <vscale x 1 x i64> @vmv.v.x_vl1() nounwind {
803+
; CHECK-LABEL: vmv.v.x_vl1:
804+
; CHECK: # %bb.0: # %entry
805+
; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
806+
; CHECK-NEXT: vmv.v.i v8, 1
807+
; CHECK-NEXT: vadd.vv v8, v8, v8
808+
; CHECK-NEXT: ret
809+
entry:
810+
%1 = tail call <vscale x 1 x i64> @llvm.riscv.vmv.v.x(
811+
<vscale x 1 x i64> poison,
812+
i64 1,
813+
i64 1)
814+
%2 = tail call <vscale x 1 x i64> @llvm.riscv.vadd(
815+
<vscale x 1 x i64> poison,
816+
<vscale x 1 x i64> %1,
817+
<vscale x 1 x i64> %1,
818+
i64 2)
819+
ret <vscale x 1 x i64> %2
820+
}
821+
822+
define <vscale x 1 x double> @vfmv.v.f_vl1(double %f) nounwind {
823+
; CHECK-LABEL: vfmv.v.f_vl1:
824+
; CHECK: # %bb.0: # %entry
825+
; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
826+
; CHECK-NEXT: vfmv.s.f v8, fa0
827+
; CHECK-NEXT: vfadd.vv v8, v8, v8
828+
; CHECK-NEXT: ret
829+
entry:
830+
%1 = tail call <vscale x 1 x double> @llvm.riscv.vfmv.v.f(
831+
<vscale x 1 x double> poison,
832+
double %f,
833+
i64 1)
834+
%2 = tail call <vscale x 1 x double> @llvm.riscv.vfadd(
835+
<vscale x 1 x double> poison,
836+
<vscale x 1 x double> %1,
837+
<vscale x 1 x double> %1,
838+
i64 7,
839+
i64 2)
840+
ret <vscale x 1 x double> %2
841+
}
842+
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
843+
; DEPVL: {{.*}}
844+
; NODEPVL: {{.*}}

0 commit comments

Comments
 (0)