]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[RISC-V] Force several tests to use rocket tuning
authorJeff Law <jlaw@ventanamicro.com>
Fri, 20 Jun 2025 02:58:56 +0000 (20:58 -0600)
committerJeff Law <jlaw@ventanamicro.com>
Fri, 20 Jun 2025 02:58:56 +0000 (20:58 -0600)
My tester has been flagging these regressions since the default cost model was
committed, along with several others

> unix/-march=rv64gc_zba_zbb_zbs_zicond: gcc: gcc.target/riscv/rvv/vsetvl/avl_single-37.c   -O2   scan-assembler-times \\.L[0-9]+\\:\\s+addi\\s+\\s*[a-x0-9]+,\\s*[a-x0-9]+,\\s*[0-9]00\\s+addi\\s+\\s*[a-x0-9]+,\\s*[a-x0-9]+,\\s*[0-9]00\\s+addi\\s+\\s*[a-x0-9]+,\\s*[a-x0-9]+,\\s*[0-9]00\\s+add\\s+\\s*[a-x0-9]+,\\s*[a-x0-9]+,\\s*[a-x0-9]+\\s+\\.L[0-9]+\\: 1
> unix/-march=rv64gc_zba_zbb_zbs_zicond: gcc: gcc.target/riscv/rvv/vsetvl/avl_single-37.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none   scan-assembler-times \\.L[0-9]+\\:\\s+addi\\s+\\s*[a-x0-9]+,\\s*[a-x0-9]+,\\s*[0-9]00\\s+addi\\s+\\s*[a-x0-9]+,\\s*[a-x0-9]+,\\s*[0-9]00\\s+addi\\s+\\s*[a-x0-9]+,\\s*[a-x0-9]+,\\s*[0-9]00\\s+add\\s+\\s*[a-x0-9]+,\\s*[a-x0-9]+,\\s*[a-x0-9]+\\s+\\.L[0-9]+\\: 1
> unix/-march=rv64gc_zba_zbb_zbs_zicond: gcc: gcc.target/riscv/rvv/vsetvl/avl_single-37.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects   scan-assembler-times \\.L[0-9]+\\:\\s+addi\\s+\\s*[a-x0-9]+,\\s*[a-x0-9]+,\\s*[0-9]00\\s+addi\\s+\\s*[a-x0-9]+,\\s*[a-x0-9]+,\\s*[0-9]00\\s+addi\\s+\\s*[a-x0-9]+,\\s*[a-x0-9]+,\\s*[0-9]00\\s+add\\s+\\s*[a-x0-9]+,\\s*[a-x0-9]+,\\s*[a-x0-9]+\\s+\\.L[0-9]+\\: 1

I really question the value of checking the output that precisely in these
tests -- they're supposed to be checking vsetvl correctness and optimization,
so the ordering and such of scalar ops shouldn't really be important at all.

Regardless, since I don't know these tests at all I resisted the temptation to
rip out the undesirable aspects of the test.

Next up, fix the bogus scan or force the old cost model (rocket).  I choose the
latter as a path of least resistance and least surprise.

Waiting for pre-commit CI to spin.

gcc/testsuite
* gcc.target/riscv/rvv/vsetvl/avl_single-37.c: Force rocket tuning.
* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-17.c: Likewise.
* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-18.c: Likewise.
* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-19.c: Likewise.
* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-20.c: Likewise.

gcc/testsuite/gcc.target/riscv/rvv/vsetvl/avl_single-37.c
gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-17.c
gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-18.c
gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-19.c
gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-20.c

index cd3e961cefe121c06fc3fad6ba561af202d2fd66..9bade063f17ec8827ccbaae3aa5cda4de9b4a6c6 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-mrvv-vector-bits=scalable -march=rv32gcv -mabi=ilp32 -fno-schedule-insns -fno-schedule-insns2 -fno-tree-vectorize" } */
+/* { dg-options "-mrvv-vector-bits=scalable -march=rv32gcv -mabi=ilp32 -fno-schedule-insns -fno-schedule-insns2 -fno-tree-vectorize -mtune=rocket" } */
 
 #include "riscv_vector.h"
 
index d7f6d18d1d611e386d675d9271f0adb8c0f4b298..321eb3b9f2983d80bcecc8fa7b6c59dc4c3c1ab2 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-mrvv-vector-bits=scalable -march=rv32gcv -mabi=ilp32 -fno-tree-vectorize" } */
+/* { dg-options "-mrvv-vector-bits=scalable -march=rv32gcv -mabi=ilp32 -fno-tree-vectorize -mtune=rocket" } */
 
 #include "riscv_vector.h"
 
index 1354c5e46d0203d555f2585cd10b15c5436c0a4d..29dcfefbd0cfb8224c79b3209e557896d7357146 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-mrvv-vector-bits=scalable -march=rv32gcv -mabi=ilp32 -fno-tree-vectorize" } */
+/* { dg-options "-mrvv-vector-bits=scalable -march=rv32gcv -mabi=ilp32 -fno-tree-vectorize -mtune=rocket" } */
 
 #include "riscv_vector.h"
 
index 6366dd9db44fec46af813c4aeeff3578324b1386..8b6299e99d1f4e48701bbcf4405d1c2c875ca352 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-mrvv-vector-bits=scalable -march=rv32gcv -mabi=ilp32 -fno-tree-vectorize" } */
+/* { dg-options "-mrvv-vector-bits=scalable -march=rv32gcv -mabi=ilp32 -fno-tree-vectorize -mtune=rocket" } */
 
 #include "riscv_vector.h"
 
index bbff028dad1637c01ce3e52ee81e274a3c04e2e0..3b836f927d20aa9bbd66524bea6f1a3598252b5f 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-mrvv-vector-bits=scalable -march=rv32gcv -mabi=ilp32 -fno-tree-vectorize" } */
+/* { dg-options "-mrvv-vector-bits=scalable -march=rv32gcv -mabi=ilp32 -fno-tree-vectorize -mtune=rocket" } */
 
 #include "riscv_vector.h"