Hi Pan,

During investigate the combine from vec_dup and vop.vv into
vop.vx, we need to depend on the cost of the insn operate
from the gr to vr, for example, vadd.vx.  Thus, for better
control and test, we introduce a new option, aka below:

--param=rvv-gr2vr-cost=<unsigned int>

+static inline int
+get_vector_gr2vr_cost ()
+{
+  int cost = get_vector_costs ()->regmove->GR2VR;
+
+  if (rvv_gr2vr_cost != RVV_GR2VR_COST_UNPROVIDED)
+    cost = rvv_gr2vr_cost;
+
+  return cost;
+}

The series looks generally reasonable to me now, thanks. But if we have a parameter that sets GR2VR IMHO it should affect all of its uses. That means we should either adjust the regmove costs directly or use the new helper whenever GR2VR is currently used.

As we only have a single regmove struct it shouldn't be too difficult to adjust it directly.

Regarding naming - I don't have a strong opinion here but GPR is a more common term than GR. So how about just --param=gpr2vr-cost=?

--
Regards
Robin

Reply via email to