https://gcc.gnu.org/g:f0551dea5fba27ba06c6900391eccf0d0a5661ba
commit r17-4452-gf0551dea5fba27ba06c6900391eccf0d0a5661ba Author: Bohan Lei <[email protected]> Date: Fri Sep 18 15:45:29 2026 -0600 [PATCH v2 1/2] RISC-V: Compare costs under -mrvv-max-lmul=dynamic Compared to v1, the patch now removes the early VLS rejection completely, and considers scenarios where `this` has spills while `other` does not, which can happen when VLS is legal for unknown-iters loops. It is also different from the early implementation in that we now don't trigger the early return when both main loops have spills. It has caused several vect dump expectation changes in some testcases, but the final assembly for them remains identical. --- When the iteration count is unknown, actually compare the costs of different VLA modes instead of blindly choosing the bigger LMUL as long as there's no unexpected spill. This can prevent some cases when -mrvv-max-lmul=dynamic emits worse code than -mrvv-max-lmul=m8, and consistent with the current implementation of check_vectorise_memory_operation in riscv-string.cc, which chooses the smallest possible LMUL, instead of m8 for all cases. This patch used to be a part of the m1-dynamic patch I proposed earlier, but as this can be justified independently, I split this out. As I changed the `else if` branch to an independent if-clause, it can now affect both dynamic and conv-dynamic. I am not quite sure but I guess avoiding a VLS loop for unknown niter cases would be reasonable as well for conv-dynamic when neither is preferred by the conv-dynamic heuristics. When running the regression tests, I found several testcases, including vec_sat_u_sub_zip.c, contain multiline DejaGnu directives that are not supported by the DejaGnu framework. I plan to fix them in a separate testsuite-only patch. gcc/ChangeLog: * config/riscv/riscv-vector-costs.cc (costs::better_main_loop_than_p): Compare VLA costs under -mrvv-max-lmul=dynamic. gcc/testsuite/ChangeLog: * gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul-mixed-1.c: Update expectation. * gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-1.c: Ditto. * gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-2.c: Ditto. * gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-3.c: Ditto. * gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-4.c: Ditto. * gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-5.c: Ditto. * gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-6.c: Ditto. * gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-7.c: Ditto. * gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-1.c: Ditto. * gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-3.c: Ditto. * gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-4.c: Ditto. * gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-5.c: Ditto. * gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-6.c: Ditto. * gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-6.c: Ditto. * gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul8-12.c: Ditto. * gcc.dg/vect/costmodel/riscv/rvv/pr111848.c: Ditto. * gcc.target/riscv/rvv/autovec/partial/slp-16.c: Ditto. * gcc.target/riscv/rvv/autovec/sat/vec_sat_u_sub_zip.c: Ditto. Diff: --- gcc/config/riscv/riscv-vector-costs.cc | 21 ++------------------- .../vect/costmodel/riscv/rvv/dynamic-lmul-mixed-1.c | 2 +- .../vect/costmodel/riscv/rvv/dynamic-lmul1-1.c | 2 +- .../vect/costmodel/riscv/rvv/dynamic-lmul1-2.c | 2 +- .../vect/costmodel/riscv/rvv/dynamic-lmul1-3.c | 2 +- .../vect/costmodel/riscv/rvv/dynamic-lmul1-4.c | 2 +- .../vect/costmodel/riscv/rvv/dynamic-lmul1-5.c | 2 +- .../vect/costmodel/riscv/rvv/dynamic-lmul1-6.c | 2 +- .../vect/costmodel/riscv/rvv/dynamic-lmul1-7.c | 2 +- .../vect/costmodel/riscv/rvv/dynamic-lmul2-1.c | 2 +- .../vect/costmodel/riscv/rvv/dynamic-lmul2-3.c | 2 +- .../vect/costmodel/riscv/rvv/dynamic-lmul2-4.c | 2 +- .../vect/costmodel/riscv/rvv/dynamic-lmul2-5.c | 2 +- .../vect/costmodel/riscv/rvv/dynamic-lmul2-6.c | 2 +- .../vect/costmodel/riscv/rvv/dynamic-lmul4-6.c | 4 ++-- .../vect/costmodel/riscv/rvv/dynamic-lmul8-12.c | 4 ++-- .../gcc.dg/vect/costmodel/riscv/rvv/pr111848.c | 2 +- .../gcc.target/riscv/rvv/autovec/partial/slp-16.c | 4 ++-- .../riscv/rvv/autovec/sat/vec_sat_u_sub_zip.c | 2 +- 19 files changed, 23 insertions(+), 40 deletions(-) diff --git a/gcc/config/riscv/riscv-vector-costs.cc b/gcc/config/riscv/riscv-vector-costs.cc index 8e5e55dde8a5..02c2039afd0c 100644 --- a/gcc/config/riscv/riscv-vector-costs.cc +++ b/gcc/config/riscv/riscv-vector-costs.cc @@ -1239,13 +1239,13 @@ costs::better_main_loop_than_p (const vector_costs *uncast_other) const } else if (rvv_max_lmul == RVV_DYNAMIC) { - if (other->m_has_unexpected_spills_p) + if (this->m_has_unexpected_spills_p != other->m_has_unexpected_spills_p) { if (dump_enabled_p ()) dump_printf_loc (MSG_NOTE, vect_location, "Preferring smaller LMUL loop because" " it has unexpected spills\n"); - return true; + return !this->m_has_unexpected_spills_p; } else if (riscv_vla_mode_p (other_loop_vinfo->vector_mode)) { @@ -1261,25 +1261,8 @@ costs::better_main_loop_than_p (const vector_costs *uncast_other) const return false; } } - else - { - if (dump_enabled_p ()) - dump_printf_loc (MSG_NOTE, vect_location, - "Keep current LMUL loop because" - " it is unknown NITERS\n"); - return false; - } } } - /* If NITERS is unknown, we should not use VLS modes to vectorize - the loop since we don't support partial vectors for VLS modes, - that is, we will have full vectors (VLSmodes) on loop body - and partial vectors (VLAmodes) on loop epilogue which is very - inefficient. Instead, we should apply partial vectors (VLAmodes) - on loop body without an epilogue on unknown NITERS loop. */ - else if (!LOOP_VINFO_NITERS_KNOWN_P (this_loop_vinfo) - && m_cost_type == VLS_VECTOR_COST) - return false; /* Fall back to generic costing if either iteration count is unknown. For known iteration counts, include loop overhead when comparing different diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul-mixed-1.c b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul-mixed-1.c index 8d0002805db7..47ca3074b409 100644 --- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul-mixed-1.c +++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul-mixed-1.c @@ -44,4 +44,4 @@ foo (int32_t *__restrict a, int32_t *__restrict b, int32_t *__restrict c, /* { dg-final { scan-assembler {e32,m2} } } */ /* { dg-final { scan-assembler {e32,m8} } } */ /* { dg-final { scan-assembler-not {csrr} } } */ -/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 2 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-1.c b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-1.c index d5fd0f2e3206..b40b467651a2 100644 --- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-1.c +++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-1.c @@ -85,7 +85,7 @@ foo (int32_t *__restrict a, int32_t *__restrict b, int32_t *__restrict c, /* { dg-final { scan-assembler {e32,m1} } } */ /* { dg-final { scan-assembler-not {csrr} } } */ -/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 3 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 8" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 4" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 2" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-2.c b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-2.c index a0e61303e80f..e1fb4b385a75 100644 --- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-2.c +++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-2.c @@ -57,7 +57,7 @@ foo (int32_t *__restrict a, int32_t *__restrict b, int32_t *__restrict c, /* FIXME: Choosing LMUL = 1 is not the optimal since it can be LMUL = 2 if we apply instruction scheduler. */ /* { dg-final { scan-assembler {e32,m1} } } */ /* { dg-final { scan-assembler-not {csrr} } } */ -/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 3 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 8" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 4" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 2" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-3.c b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-3.c index 2111c0bbc9a2..08f202f8602e 100644 --- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-3.c +++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-3.c @@ -85,7 +85,7 @@ foo (int8_t *__restrict a, int8_t *__restrict b, int8_t *__restrict c, /* { dg-final { scan-assembler {e8,m1} } } */ /* { dg-final { scan-assembler-not {csrr} } } */ -/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 3 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 8" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 4" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 2" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-4.c b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-4.c index c47a4c4ceb17..d6c8faaf8f78 100644 --- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-4.c +++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-4.c @@ -115,7 +115,7 @@ foo (int32_t *__restrict a, int32_t *__restrict b, int32_t *__restrict c, /* { dg-final { scan-assembler {e32,m1} } } */ /* { dg-final { scan-assembler-not {csrr} } } */ -/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 3 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 8" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 4" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 2" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-5.c b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-5.c index e4b74f037e3b..d006918c4104 100644 --- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-5.c +++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-5.c @@ -143,7 +143,7 @@ foo (int32_t *__restrict a, int32_t *__restrict b, int32_t *__restrict c, /* { dg-final { scan-assembler {e32,m1} } } */ /* { dg-final { scan-assembler-not {csrr} } } */ -/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 3 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 8" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 4" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 2" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-6.c b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-6.c index 73d16dab7324..f8b0283252f2 100644 --- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-6.c +++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-6.c @@ -144,7 +144,7 @@ foo (int8_t *__restrict a, int8_t *__restrict b, int8_t *__restrict c, /* { dg-final { scan-assembler {e8,m1} } } */ /* { dg-final { scan-assembler-not {csrr} } } */ -/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 3 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 8" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 4" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 2" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-7.c b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-7.c index b76bb4b06b4b..a1f9ad0fa71e 100644 --- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-7.c +++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-7.c @@ -42,7 +42,7 @@ foo (int32_t *__restrict a, int32_t *__restrict b, int32_t *__restrict c, /* { dg-final { scan-assembler {e32,m1} } } */ /* { dg-final { scan-assembler-not {csrr} { xfail "*-*-*" } } } */ -/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 3 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 8" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 4" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 2" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-1.c b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-1.c index 6637f3c3e3f4..9eac4cc92219 100644 --- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-1.c +++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-1.c @@ -45,7 +45,7 @@ foo (int32_t *__restrict a, int32_t *__restrict b, int32_t *__restrict c, /* { dg-final { scan-assembler {e32,m2} } } */ /* { dg-final { scan-assembler-not {csrr} } } */ -/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 2 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 8" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 4" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 2" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-3.c b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-3.c index 6637f3c3e3f4..9eac4cc92219 100644 --- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-3.c +++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-3.c @@ -45,7 +45,7 @@ foo (int32_t *__restrict a, int32_t *__restrict b, int32_t *__restrict c, /* { dg-final { scan-assembler {e32,m2} } } */ /* { dg-final { scan-assembler-not {csrr} } } */ -/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 2 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 8" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 4" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 2" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-4.c b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-4.c index a8e603f90f36..49cbbdb2420a 100644 --- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-4.c +++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-4.c @@ -43,7 +43,7 @@ foo (int32_t *__restrict a, int32_t *__restrict b, int32_t *__restrict c, /* { dg-final { scan-assembler {e32,m2} } } */ /* { dg-final { scan-assembler-not {csrr} } } */ -/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 2 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 8" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 4" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 2" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-5.c b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-5.c index dcb20a302c83..75d3ecddc598 100644 --- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-5.c +++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-5.c @@ -46,7 +46,7 @@ foo (int32_t *__restrict a, int32_t *__restrict b, int32_t *__restrict c, /* { dg-final { scan-assembler {e32,m2} } } */ /* { dg-final { scan-assembler {e8,m8} } } */ /* { dg-final { scan-assembler-not {csrr} } } */ -/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 2 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 8" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 4" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 2" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-6.c b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-6.c index f5d1a02736a7..5bcffff7524e 100644 --- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-6.c +++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-6.c @@ -48,4 +48,4 @@ foo (int32_t *__restrict a, int32_t *__restrict b, int32_t *__restrict c, /* { dg-final { scan-assembler {e32,m2} } } */ /* { dg-final { scan-assembler {e8,m8} } } */ /* { dg-final { scan-assembler-not {csrr} } } */ -/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 2 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-6.c b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-6.c index 365fdf2a7498..ba2eacaccd27 100644 --- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-6.c +++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-6.c @@ -20,8 +20,8 @@ foo (uint8_t *restrict a, uint8_t *restrict b, int n) } } -/* { dg-final { scan-assembler {e8,m4} } } */ -/* { dg-final { scan-assembler-times {csrr} 1 } } */ +/* { dg-final { scan-assembler {e8,m1} } } */ +/* { dg-final { scan-assembler-times {csrr} 0 } } */ /* Since we don't support VLA SLP for LMUL = 8, dynamic LMUL cost model start from LMUL = 4. */ /* { dg-final { scan-tree-dump-not "Preferring smaller LMUL loop because it has unexpected spills" "vect" } } */ /* { dg-final { scan-tree-dump-not "Maximum lmul = 8" "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul8-12.c b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul8-12.c index c55546394deb..0f75505f1de6 100644 --- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul8-12.c +++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul8-12.c @@ -17,8 +17,8 @@ foo (int *restrict a, int *restrict b, int n) } } -/* { dg-final { scan-assembler {e32,m8} } } */ -/* { dg-final { scan-assembler-times {csrr} 1 } } */ +/* { dg-final { scan-assembler {e32,m1} } } */ +/* { dg-final { scan-assembler-times {csrr} 0 } } */ /* { dg-final { scan-tree-dump-not "Preferring smaller LMUL loop because it has unexpected spills" "vect" } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 4" 1 "vect" { xfail *-*-* } } } */ /* { dg-final { scan-tree-dump-times "Maximum lmul = 2" 1 "vect" { xfail *-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr111848.c b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr111848.c index 339c80f8805a..2801ef499256 100644 --- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr111848.c +++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr111848.c @@ -28,7 +28,7 @@ f3 (uint8_t *restrict a, uint8_t *restrict b, } } -/* { dg-final { scan-assembler {e8,m4} } } */ +/* { dg-final { scan-assembler {e8,m1} } } */ /* { dg-final { scan-assembler-not {jr} } } */ /* { dg-final { scan-assembler-times {ret} 1 } } */ /* { dg-final { scan-tree-dump-not "Preferring smaller LMUL loop because it has unexpected spills" "vect" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/slp-16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/slp-16.c index b31453852b23..bf1bed97551c 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/slp-16.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/slp-16.c @@ -20,6 +20,6 @@ f (uint8_t *restrict a, uint8_t *restrict b, int n) } /* FIXME: Since we don't have VECT cost model yet, LOAD_LANES/STORE_LANES are chosen instead of SLP. */ -/* { dg-final { scan-tree-dump-times "\.VEC_PERM" 1 "optimized" { xfail { any-opts "-mrvv-max-lmul=m1" "-mrvv-max-lmul=m2" "-mrvv-max-lmul=m4" "-mrvv-max-lmul=m8" } } } } */ -/* { dg-final { scan-assembler {\tvid\.v} { xfail { any-opts "-mrvv-max-lmul=m1" "-mrvv-max-lmul=m2" "-mrvv-max-lmul=m4" "-mrvv-max-lmul=m8" } } } } */ +/* { dg-final { scan-tree-dump-times "\.VEC_PERM" 1 "optimized" { xfail *-*-* } } } */ +/* { dg-final { scan-assembler {\tvid\.v} { xfail *-*-* } } } */ /* { dg-final { scan-assembler-not {\tvmul} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/sat/vec_sat_u_sub_zip.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/sat/vec_sat_u_sub_zip.c index 5988df689d01..2a632838d30e 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/sat/vec_sat_u_sub_zip.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/sat/vec_sat_u_sub_zip.c @@ -17,4 +17,4 @@ DEF_VEC_SAT_U_SUB_ZIP_WRAP(uint16_t, uint32_t) /* { dg-final { scan-assembler-times {vssubu\.vv} 1 { target { any-ops "-mrvv-vector-bits=zvl" } } } } */ -/* { dg-final { scan-assembler-times {vnclipu\.wi} 2 } } */ +/* { dg-final { scan-assembler {vnclipu\.wi} } } */
