]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Add failed SLP testcase
authorJuzhe-Zhong <juzhe.zhong@rivai.ai>
Thu, 14 Dec 2023 07:47:52 +0000 (15:47 +0800)
committerPan Li <pan2.li@intel.com>
Thu, 14 Dec 2023 07:49:29 +0000 (15:49 +0800)
After recent RVV cost model tweak, I found this PR issue has been fixed.

Add testcase and committed.

PR target/112387

gcc/testsuite/ChangeLog:

* gcc.dg/vect/costmodel/riscv/rvv/pr112387.c: New test.

gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr112387.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr112387.c b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr112387.c
new file mode 100644 (file)
index 0000000..ee44b5f
--- /dev/null
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -O3 -ftree-vectorize -fdump-tree-vect-details" } */
+
+#include <stdint-gcc.h>
+
+void
+f2 (uint64_t *__restrict y, uint64_t *__restrict x,
+    uint64_t *__restrict indices, uint64_t n)
+{
+  for (int64_t i = 0; i < n; ++i)
+    {
+      y[i * 2] = x[indices[i * 2]] + 1;
+      y[i * 2 + 1] = x[indices[i * 2 + 1]] + 2;
+    }
+}
+
+/* { dg-final { scan-tree-dump "Loop contains only SLP stmts" vect } } */
+/* { dg-final { scan-assembler-not "vlseg" } } */
+/* { dg-final { scan-assembler-not "vsseg" } } */