[PATCH] D106286: [RISCV] Add a test showing an incorrect vsetvli insertion

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 21 01:08:06 PDT 2021


frasercrmck updated this revision to Diff 360377.
frasercrmck added a comment.

- remove unused vlen-bits-min


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106286/new/

https://reviews.llvm.org/D106286

Files:
  llvm/test/CodeGen/RISCV/rvv/vsetvli-regression.ll


Index: llvm/test/CodeGen/RISCV/rvv/vsetvli-regression.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/RISCV/rvv/vsetvli-regression.ll
@@ -0,0 +1,21 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=riscv64 -mattr=+experimental-v | FileCheck %s
+
+; This test checks a regression in the vsetvli insertion pass. There is an
+; illegal attempt to preserve VL in the second vsetvli with ratio e32/m1, when
+; the last update of VL was the vsetvli with e64/m4.
+
+define i32 @illegal_preserve_vl(<vscale x 2 x i32> %a, <vscale x 4 x i64> %x, <vscale x 4 x i64>* %y) {
+; CHECK-LABEL: illegal_preserve_vl:
+; CHECK:       # %bb.0:
+; CHECK-NEXT:    vsetvli a1, zero, e64, m4, ta, mu
+; CHECK-NEXT:    vadd.vv v28, v12, v12
+; CHECK-NEXT:    vs4r.v v28, (a0)
+; CHECK-NEXT:    vsetvli zero, zero, e32, m1, ta, mu
+; CHECK-NEXT:    vmv.x.s a0, v8
+; CHECK-NEXT:    ret
+  %index = add <vscale x 4 x i64> %x, %x
+  store <vscale x 4 x i64> %index, <vscale x 4 x i64>* %y
+  %elt = extractelement <vscale x 2 x i32> %a, i64 0
+  ret i32 %elt
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106286.360377.patch
Type: text/x-patch
Size: 1152 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210721/1362ac29/attachment.bin>


More information about the llvm-commits mailing list