https://gcc.gnu.org/g:2af897e11b358fccb978e3a96b2899ce193bcd25
commit r16-3148-g2af897e11b358fccb978e3a96b2899ce193bcd25 Author: Richard Henderson <richard.hender...@linaro.org> Date: Mon Aug 4 22:47:05 2025 +1000 aarch64: Consider TARGET_CMPBR in rtx costs gcc: * config/aarch64/aarch64.cc (aarch64_if_then_else_costs): Use aarch64_cb_rhs to match CB insns. Diff: --- gcc/config/aarch64/aarch64.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index d5272294f0a0..e4a9e876e7f2 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -14460,6 +14460,15 @@ aarch64_if_then_else_costs (rtx op0, rtx op1, rtx op2, int *cost, bool speed) *cost += extra_cost->alu.arith * 2; return true; } + + if (TARGET_CMPBR) + { + *cost += rtx_cost (inner, cmpmode, cmpcode, 0, speed); + if ((cmpmode != SImode && cmpmode != DImode) + || !aarch64_cb_rhs (cmpcode, comparator)) + *cost += rtx_cost (comparator, cmpmode, cmpcode, 1, speed); + return true; + } } else if (GET_MODE_CLASS (GET_MODE (inner)) == MODE_CC) {