]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Add new option --param=gpr2vr-cost= for rvv insn
authorPan Li <pan2.li@intel.com>
Tue, 6 May 2025 08:26:06 +0000 (16:26 +0800)
committerPan Li <pan2.li@intel.com>
Tue, 6 May 2025 12:31:27 +0000 (20:31 +0800)
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 gpr to vr, for example, vadd.vx.  Thus, for better
control and test, we introduce a new option, aka below:

--param=gpr2vr-cost=<unsigned int>

To specific the cost value of the insn that operate from
the gpr to vr.

gcc/ChangeLog:

* config/riscv/riscv-opts.h (RVV_GR2VR_COST_UNPROVIDED): Add
new macro to indicate the param is not provided.
* config/riscv/riscv.opt: Add new option --pararm=gpr2vr-cost.

Signed-off-by: Pan Li <pan2.li@intel.com>
gcc/config/riscv/riscv-opts.h
gcc/config/riscv/riscv.opt

index 26fe228e0f826c4b689ab24e1b5486e8406a8e79..9766b89b2dff81e26d20d095a36602aca7f7c190 100644 (file)
@@ -162,4 +162,6 @@ enum riscv_tls_type {
 #define TARGET_VECTOR_AUTOVEC_SEGMENT                                         \
   (TARGET_VECTOR && riscv_mautovec_segment)
 
+#define GPR2VR_COST_UNPROVIDED -1
+
 #endif /* ! GCC_RISCV_OPTS_H */
index 7515c8ea13ddd2deb80ec8179b2ddfe4aaf85da4..710248099b3c933a29cf36c4950df7faf80e5530 100644 (file)
@@ -579,6 +579,10 @@ Inline strlen calls if possible.
 Target RejectNegative Joined UInteger Var(riscv_strcmp_inline_limit) Init(64)
 Max number of bytes to compare as part of inlined strcmp/strncmp routines (default: 64).
 
+-param=gpr2vr-cost=
+Target RejectNegative Joined UInteger Var(gpr2vr_cost) Init(GPR2VR_COST_UNPROVIDED)
+Set the cost value of the rvv instruction when operate from GPR to VR.
+
 Enum
 Name(rvv_max_lmul) Type(enum rvv_max_lmul_enum)
 The RVV possible LMUL (-mrvv-max-lmul=):