diff options
author | Xiao Zeng <zengxiao@eswincomputing.com> | 2023-07-31 12:26:51 -0600 |
---|---|---|
committer | Jeff Law <jlaw@ventanamicro.com> | 2023-08-01 23:08:59 -0600 |
commit | e15d0b6680d10d7666195e9db65581364ad5e5df (patch) | |
tree | c7e1d3e51e90f5483c959f407c24ed04f891aded /gcc/tree-ssa-phiopt.cc | |
parent | eb0a9102a93e4a5ae8f0db707812e140100617d4 (diff) | |
download | gcc-e15d0b6680d10d7666195e9db65581364ad5e5df.zip gcc-e15d0b6680d10d7666195e9db65581364ad5e5df.tar.gz gcc-e15d0b6680d10d7666195e9db65581364ad5e5df.tar.bz2 |
[PATCH 3/5] [RISC-V] RISC-V Conditional Move costing [was:Generate Zicond instruction for select pattern with condition eq or neq to 0]
This provides some basic costing to conditional moves. The underlying
primitive of an IF-THEN-ELSE which turns into czero is a single insn
(COSTS_N_INSNS (1)).
But these insns were still consistently showing up with the wrong cost (8
instead of 4). This was chased down to computing the cost of the destination
and the cost of the source independently, then summing them. That seems
horribly wrong for register destinations. So this patch special cases
an INSN that is just a SET of a register destination so that the cost
comes from the SET_SRC.
Long term the whole costing model needs a review.
gcc/
* config/riscv/riscv.cc (riscv_rtx_costs, case IF_THEN_ELSE): Add
Zicond costing.
(case SET): For INSNs that just set a REG, take the cost from the
SET_SRC.
Co-authored-by: Jeff Law <jlaw@ventanamicro.com>
Diffstat (limited to 'gcc/tree-ssa-phiopt.cc')
0 files changed, 0 insertions, 0 deletions