From: Robin Dapp <[email protected]>
This simply costs gather/scatter according to the number of elements in the
vectype.
gcc/ChangeLog:
* config/riscv/riscv-vector-costs.cc (costs::adjust_stmt_cost):
Cost gather/scatter.
---
gcc/config/riscv/riscv-vector-costs.cc | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/gcc/config/riscv/riscv-vector-costs.cc
b/gcc/config/riscv/riscv-vector-costs.cc
index d26a390793c..db31e972638 100644
--- a/gcc/config/riscv/riscv-vector-costs.cc
+++ b/gcc/config/riscv/riscv-vector-costs.cc
@@ -1498,6 +1498,13 @@ costs::adjust_stmt_cost (enum vect_cost_for_stmt kind,
loop_vec_info loop,
break;
}
+ case vector_gather_load:
+ case vector_scatter_store:
+ {
+ stmt_cost *= vect_nunits_for_cost (vectype);
+ break;
+ }
+
default:
break;
}
--
2.56.0