[PATCH] D116306: [RISCV] Pre-commit test for Teach VSETVLInsert to eliminate redundant vsetvli for vmv.s.x and vfmv.s.f.
Jianjian Guan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 30 01:04:23 PST 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG43ff781c783d: [RISCV] Pre-commit test for Teach VSETVLInsert to eliminate redundant vsetvli… (authored by jacquesguan).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D116306/new/
https://reviews.llvm.org/D116306
Files:
llvm/test/CodeGen/RISCV/rvv/vsetvli-insert.ll
Index: llvm/test/CodeGen/RISCV/rvv/vsetvli-insert.ll
===================================================================
--- llvm/test/CodeGen/RISCV/rvv/vsetvli-insert.ll
+++ llvm/test/CodeGen/RISCV/rvv/vsetvli-insert.ll
@@ -3,6 +3,7 @@
; RUN: -verify-machineinstrs -O2 < %s | FileCheck %s
declare i64 @llvm.riscv.vsetvli(i64, i64, i64)
+declare i64 @llvm.riscv.vsetvlimax(i64, i64)
declare <vscale x 1 x double> @llvm.riscv.vfadd.nxv1f64.nxv1f64(
<vscale x 1 x double>,
<vscale x 1 x double>,
@@ -143,6 +144,67 @@
br i1 %cmp.not, label %for.cond.cleanup, label %for.body
}
+define <vscale x 1 x i64> @test7(<vscale x 1 x i64> %a, i64 %b, <vscale x 1 x i1> %mask) nounwind {
+; CHECK-LABEL: test7:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: vsetvli a1, zero, e64, m1, ta, mu
+; CHECK-NEXT: vsetivli zero, 1, e64, m1, tu, mu
+; CHECK-NEXT: vmv.s.x v8, a0
+; CHECK-NEXT: ret
+entry:
+ %x = tail call i64 @llvm.riscv.vsetvlimax(i64 3, i64 0)
+ %y = call <vscale x 1 x i64> @llvm.riscv.vmv.s.x.nxv1i64(
+ <vscale x 1 x i64> %a,
+ i64 %b, i64 1)
+
+ ret <vscale x 1 x i64> %y
+}
+
+define <vscale x 1 x i64> @test8(<vscale x 1 x i64> %a, i64 %b, <vscale x 1 x i1> %mask) nounwind {
+; CHECK-LABEL: test8:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: vsetivli a1, 6, e64, m1, ta, mu
+; CHECK-NEXT: vsetivli zero, 2, e64, m1, tu, mu
+; CHECK-NEXT: vmv.s.x v8, a0
+; CHECK-NEXT: ret
+entry:
+ %x = tail call i64 @llvm.riscv.vsetvli(i64 6, i64 3, i64 0)
+ %y = call <vscale x 1 x i64> @llvm.riscv.vmv.s.x.nxv1i64(<vscale x 1 x i64> %a, i64 %b, i64 2)
+ ret <vscale x 1 x i64> %y
+}
+
+define <vscale x 1 x i64> @test9(<vscale x 1 x i64> %a, i64 %b, <vscale x 1 x i1> %mask) nounwind {
+; CHECK-LABEL: test9:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: vsetivli zero, 9, e64, m1, tu, mu
+; CHECK-NEXT: vadd.vv v8, v8, v8, v0.t
+; CHECK-NEXT: vsetivli zero, 2, e64, m1, tu, mu
+; CHECK-NEXT: vmv.s.x v8, a0
+; CHECK-NEXT: ret
+entry:
+ %x = call <vscale x 1 x i64> @llvm.riscv.vadd.mask.nxv1i64.nxv1i64(
+ <vscale x 1 x i64> %a,
+ <vscale x 1 x i64> %a,
+ <vscale x 1 x i64> %a,
+ <vscale x 1 x i1> %mask,
+ i64 9,
+ i64 0)
+ %y = call <vscale x 1 x i64> @llvm.riscv.vmv.s.x.nxv1i64(<vscale x 1 x i64> %x, i64 %b, i64 2)
+ ret <vscale x 1 x i64> %y
+}
+
+declare <vscale x 1 x i64> @llvm.riscv.vadd.mask.nxv1i64.nxv1i64(
+ <vscale x 1 x i64>,
+ <vscale x 1 x i64>,
+ <vscale x 1 x i64>,
+ <vscale x 1 x i1>,
+ i64,
+ i64);
+
+declare <vscale x 1 x i64> @llvm.riscv.vmv.s.x.nxv1i64(
+ <vscale x 1 x i64>,
+ i64,
+ i64);
declare i64 @llvm.riscv.vsetvli.i64(i64, i64 immarg, i64 immarg)
declare <vscale x 2 x i32> @llvm.riscv.vle.nxv2i32.i64(<vscale x 2 x i32>* nocapture, i64)
declare <vscale x 2 x i1> @llvm.riscv.vmslt.nxv2i32.i32.i64(<vscale x 2 x i32>, i32, i64)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116306.396628.patch
Type: text/x-patch
Size: 2873 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211230/5933eba3/attachment.bin>
More information about the llvm-commits
mailing list