]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Refactor the testcases for RVV gather/scatter
authorPan Li <pan2.li@intel.com>
Mon, 25 Nov 2024 03:45:30 +0000 (11:45 +0800)
committerPan Li <pan2.li@intel.com>
Tue, 26 Nov 2024 12:53:55 +0000 (20:53 +0800)
This patch would like to refactor the testcases of gather/scatter
after sorts of optimization option passing to testcase.  Includes:

* Remove unnecessary optimization options.
* Adjust dg-final by any-opts and/or no-opts if the rtl dump changes
  on different optimization options (like O2, O3).

The below test suites are passed for this patch.
* The rv64gcv fully regression test.

It is test only patch and obvious up to a point, will commit it
directly if no comments in next 48H.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/gather-scatter/gather_load_64-12-zvbb.c:
Adjust the dump check times.
* gcc.target/riscv/rvv/autovec/gather-scatter/strided_load-1.c:
Remove unnecessary option and add target no-opts/any-tops.
* gcc.target/riscv/rvv/autovec/gather-scatter/strided_load-2.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/strided_store-1.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/strided_store-2.c: Ditto.

Signed-off-by: Pan Li <pan2.li@intel.com>
gcc/testsuite/gcc.target/riscv/rvv/autovec/gather-scatter/gather_load_64-12-zvbb.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/gather-scatter/strided_load-1.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/gather-scatter/strided_load-2.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/gather-scatter/strided_store-1.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/gather-scatter/strided_store-2.c

index 11a4031f47bb04d3489a0d92bcb61e081cc323a2..1fd3644886ac0f6865c8c8d30128e1fd6edaa706 100644 (file)
@@ -106,7 +106,7 @@ TEST_LOOP (_Float16, uint64_t)
 TEST_LOOP (float, uint64_t)
 TEST_LOOP (double, uint64_t)
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 88 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 80 "vect" } } */
 /* { dg-final { scan-tree-dump " \.MASK_LEN_GATHER_LOAD" "vect" } } */
 /* { dg-final { scan-tree-dump-not " \.GATHER_LOAD" "vect" } } */
 /* { dg-final { scan-tree-dump-not " \.MASK_GATHER_LOAD" "vect" } } */
index 79b39f102bf26229cf68fb68eba35076048512c7..b8c9669fa5414b3865d62fd8ac7cb0e2dd73ae9d 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-march=rv64gcv_zvfh -mabi=lp64d -O3 -mrvv-vector-bits=scalable -fno-vect-cost-model -ffast-math -fdump-tree-optimized-details" } */
+/* { dg-options "-march=rv64gcv_zvfh -mabi=lp64d -mrvv-vector-bits=scalable -fno-vect-cost-model -ffast-math -fdump-tree-optimized-details" } */
 
 #include <stdint-gcc.h>
 
 
 TEST_ALL (TEST_LOOP)
 
-/* { dg-final { scan-tree-dump-times " \.MASK_LEN_STRIDED_LOAD " 66 "optimized" } } */
+/* { dg-final { scan-tree-dump-times " \.MASK_LEN_STRIDED_LOAD " 66 "optimized" { target { any-opts
+     "-O3"
+   } } } } */
+/* { dg-final { scan-tree-dump-times " \.MASK_LEN_STRIDED_LOAD " 44 "optimized" { target { any-opts
+     "-O2"
+   } } } } */
 /* { dg-final { scan-tree-dump-not " \.GATHER_LOAD" "optimized" } } */
 /* { dg-final { scan-tree-dump-not " \.MASK_GATHER_LOAD" "optimized" } } */
index 8a452e547a399aa5ea64101dedc084e9c79f64db..dab9658b12b89ed71eab55e09fb2ab8b59760d1f 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-march=rv64gcv_zvfh -mabi=lp64d -O3 -mrvv-vector-bits=scalable -fno-vect-cost-model -ffast-math -fdump-tree-optimized-details" } */
+/* { dg-options "-march=rv64gcv_zvfh -mabi=lp64d -mrvv-vector-bits=scalable -fno-vect-cost-model -ffast-math -fdump-tree-optimized-details" } */
 
 #include <stdint-gcc.h>
 
 
 TEST_ALL (TEST_LOOP)
 
-/* { dg-final { scan-tree-dump-times " \.MASK_LEN_STRIDED_LOAD " 33 "optimized" } } */
+/* { dg-final { scan-tree-dump-times " \.MASK_LEN_STRIDED_LOAD " 64 "optimized" { target { any-opts {
+     "-mrvv-max-lmul=m8"
+     "-mrvv-max-lmul=dynamic"
+   } } } } */
+/* { dg-final { scan-tree-dump-times " \.MASK_LEN_STRIDED_LOAD " 56 "optimized" { target { any-opts {
+     "-mrvv-max-lmul=m4"
+   } } } } */
+/* { dg-final { scan-tree-dump-times " \.MASK_LEN_STRIDED_LOAD " 50 "optimized" { target { any-opts {
+     "-mrvv-max-lmul=m2"
+   } } } } */
+/* { dg-final { scan-tree-dump-times " \.MASK_LEN_STRIDED_LOAD " 33 "optimized" { target { any-opts {
+     "-mrvv-max-lmul=m1"
+   } } } } */
 /* { dg-final { scan-tree-dump-not " \.GATHER_LOAD" "optimized" } } */
 /* { dg-final { scan-tree-dump-not " \.MASK_GATHER_LOAD" "optimized" } } */
index ec8c3a5c63a4ac0bd1b423973a2de11b6a9aa8b1..905fe2038e72bc1922ccad2692e411e7cf6ee72c 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-march=rv64gcv_zvfh -mabi=lp64d -O3 -mrvv-vector-bits=scalable -fno-vect-cost-model -ffast-math -fdump-tree-optimized-details" } */
+/* { dg-options "-march=rv64gcv_zvfh -mabi=lp64d -mrvv-vector-bits=scalable -fno-vect-cost-model -ffast-math -fdump-tree-optimized-details" } */
 
 #include <stdint-gcc.h>
 
 
 TEST_ALL (TEST_LOOP)
 
-/* { dg-final { scan-tree-dump-times " \.MASK_LEN_STRIDED_STORE" 66 "optimized" } } */
+/* { dg-final { scan-tree-dump-times " \.MASK_LEN_STRIDED_STORE" 66 "optimized" { target { any-opts {
+     "-O3"
+   } } } } } */
+/* { dg-final { scan-tree-dump-times " \.MASK_LEN_STRIDED_STORE" 44 "optimized" { target { any-opts {
+     "-O2"
+   } } } } } */
 /* { dg-final { scan-tree-dump-not " \.SCATTER_STORE" "optimized" } } */
 /* { dg-final { scan-tree-dump-not " \.MASK_SCATTER_STORE" "optimized" } } */
index b433b5b5210415376081c2f0a28b44d5c11e792a..4acac8f7efd8a25a7061a3fa601af256914cbcce 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-march=rv64gcv_zvfh -mabi=lp64d -O3 -mrvv-vector-bits=scalable -fno-vect-cost-model -ffast-math -fdump-tree-optimized-details" } */
+/* { dg-options "-march=rv64gcv_zvfh -mabi=lp64d -mrvv-vector-bits=scalable -fno-vect-cost-model -ffast-math -fdump-tree-optimized-details" } */
 
 #include <stdint-gcc.h>