From: Pan Li <[email protected]>

After the middle-end involve slp_node and vectype to the
record_stmt_cost, we found some test like vx_vf/vx-4* is failed
to vectorize.  Per-suggestion from Richard, it is a backend issue that
makes the vector costs is greater than scalar.

After some investigation, the adjust_stmt_cost doesn't pick up the
param from command line and always get 2 here.

        PR/target 123916

gcc/ChangeLog:

        * config/riscv/riscv-vector-costs.cc (costs::adjust_stmt_cost):

Signed-off-by: Pan Li <[email protected]>
---
 gcc/config/riscv/riscv-vector-costs.cc | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/gcc/config/riscv/riscv-vector-costs.cc 
b/gcc/config/riscv/riscv-vector-costs.cc
index 782796ed43e..1d137a61fb9 100644
--- a/gcc/config/riscv/riscv-vector-costs.cc
+++ b/gcc/config/riscv/riscv-vector-costs.cc
@@ -1249,13 +1249,10 @@ costs::adjust_stmt_cost (enum vect_cost_for_stmt kind, 
loop_vec_info loop,
   switch (kind)
     {
     case scalar_to_vec:
+    case vec_to_scalar:
       stmt_cost
        += (FLOAT_TYPE_P (vectype) ? get_fr2vr_cost () : get_gr2vr_cost ());
       break;
-    case vec_to_scalar:
-      stmt_cost += (FLOAT_TYPE_P (vectype) ? costs->regmove->VR2FR
-                   : costs->regmove->VR2GR);
-      break;
     case vector_load:
     case vector_store:
        {
-- 
2.43.0

Reply via email to