From: Richard Henderson Date: Mon, 4 Aug 2025 12:47:05 +0000 (+1000) Subject: aarch64: Consider TARGET_CMPBR in rtx costs X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2af897e11b358fccb978e3a96b2899ce193bcd25;p=thirdparty%2Fgcc.git 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 --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index d5272294f0a..e4a9e876e7f 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) {