On 9/8/25 1:08 AM, Robin Dapp wrote:
diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index 07d40f459e3..bfd43fba101 100644
--- a/gcc/config/riscv/riscv.cc
+++ b/gcc/config/riscv/riscv.cc
@@ -659,7 +659,7 @@ static const struct riscv_tune_param
tt_ascalon_d8_tune_info = {
{COSTS_N_INSNS (3), COSTS_N_INSNS (3)}, /* int_mul */
{COSTS_N_INSNS (13), COSTS_N_INSNS (13)}, /* int_div */
8, /* issue_rate */
- 3, /* branch_cost */
+ 4, /* branch_cost */
4, /* memory_cost */
4, /* fmv_cost */
false, /* slow_unaligned_access */
While empirical branch costing has been mostly the norm, still the
question:
Why is 3 not enough in this particular case? Is the sequence we cost
complicated and we simplify it later on, confusing the cost model? Or
something where we should do better from an ifcvt point-of-view?
The case itself looks vaguely familiar, maybe similar to what Jeff has
been looking at before, so he might know.
The patch is OK of course.
The cost is 4 because of the zero-extension in the sequence to convert
from HI to DI. At least that's what it looks like to me.
Regardless, this is OK for the the trunk.
jeff