[llvm] dbbbc9e - [riscv] Add a couple more vsetvli tests
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Tue May 3 16:50:02 PDT 2022
Author: Philip Reames
Date: 2022-05-03T16:49:52-07:00
New Revision: dbbbc9e2ca4bf0839cef49505a798d7404809e7c
URL: https://github.com/llvm/llvm-project/commit/dbbbc9e2ca4bf0839cef49505a798d7404809e7c
DIFF: https://github.com/llvm/llvm-project/commit/dbbbc9e2ca4bf0839cef49505a798d7404809e7c.diff
LOG: [riscv] Add a couple more vsetvli tests
Added:
Modified:
llvm/test/CodeGen/RISCV/rvv/vsetvli-insert.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/RISCV/rvv/vsetvli-insert.ll b/llvm/test/CodeGen/RISCV/rvv/vsetvli-insert.ll
index 41b179e6612dc..ebdb4f99e9df2 100644
--- a/llvm/test/CodeGen/RISCV/rvv/vsetvli-insert.ll
+++ b/llvm/test/CodeGen/RISCV/rvv/vsetvli-insert.ll
@@ -254,6 +254,53 @@ entry:
ret <vscale x 1 x double> %0
}
+define <vscale x 1 x double> @test14(i64 %avl, <vscale x 1 x double> %a, <vscale x 1 x double> %b) nounwind {
+; CHECK-LABEL: test14:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: vsetvli a0, a0, e32, mf2, ta, mu
+; CHECK-NEXT: vsetivli zero, 1, e64, m1, ta, mu
+; CHECK-NEXT: vfadd.vv v8, v8, v9
+; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, mu
+; CHECK-NEXT: vfadd.vv v8, v8, v9
+; CHECK-NEXT: ret
+entry:
+ %vsetvli = tail call i64 @llvm.riscv.vsetvli(i64 %avl, i64 2, i64 7)
+ %f1 = tail call <vscale x 1 x double> @llvm.riscv.vfadd.nxv1f64.nxv1f64(
+ <vscale x 1 x double> undef,
+ <vscale x 1 x double> %a,
+ <vscale x 1 x double> %b,
+ i64 1)
+ %f2 = tail call <vscale x 1 x double> @llvm.riscv.vfadd.nxv1f64.nxv1f64(
+ <vscale x 1 x double> undef,
+ <vscale x 1 x double> %f1,
+ <vscale x 1 x double> %b,
+ i64 %vsetvli)
+ ret <vscale x 1 x double> %f2
+}
+
+define <vscale x 1 x double> @test15(i64 %avl, <vscale x 1 x double> %a, <vscale x 1 x double> %b) nounwind {
+; CHECK-LABEL: test15:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: vsetvli a0, a0, e64, m1, ta, mu
+; CHECK-NEXT: vfadd.vv v8, v8, v9
+; CHECK-NEXT: vfadd.vv v8, v8, v9
+; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, mu
+; CHECK-NEXT: ret
+entry:
+ %vsetvli = tail call i64 @llvm.riscv.vsetvli(i64 %avl, i64 2, i64 7)
+ %f1 = tail call <vscale x 1 x double> @llvm.riscv.vfadd.nxv1f64.nxv1f64(
+ <vscale x 1 x double> undef,
+ <vscale x 1 x double> %a,
+ <vscale x 1 x double> %b,
+ i64 %avl)
+ %f2 = tail call <vscale x 1 x double> @llvm.riscv.vfadd.nxv1f64.nxv1f64(
+ <vscale x 1 x double> undef,
+ <vscale x 1 x double> %f1,
+ <vscale x 1 x double> %b,
+ i64 %vsetvli)
+ ret <vscale x 1 x double> %f2
+}
+
declare <vscale x 1 x i64> @llvm.riscv.vadd.mask.nxv1i64.nxv1i64(
<vscale x 1 x i64>,
<vscale x 1 x i64>,
More information about the llvm-commits
mailing list