REGs are unique. This patch recognizes that fact, speeding up rs6000 gcc infinitesimally. Bootstrapped etc. powerpc64le-linux. OK?
* gcc/config/rs6000/rs6000.c (rs6000_legitimate_address_p): Replace rtx_equal_p call for known REGs with pointer comparison. (rs6000_secondary_reload_memory): Likewise. (rs6000_secondary_reload_inner): Likewise. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index d3355710d91..9c3e0ea3529 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -9227,7 +9227,7 @@ rs6000_legitimate_address_p (machine_mode mode, rtx x, bool reg_ok_strict) reg_ok_strict, false) || (!avoiding_indexed_address_p (mode) && legitimate_indexed_address_p (XEXP (x, 1), reg_ok_strict))) - && rtx_equal_p (XEXP (XEXP (x, 1), 0), XEXP (x, 0))) + && XEXP (XEXP (x, 1), 0) == XEXP (x, 0)) return 1; if (reg_offset_p && !quad_offset_p && legitimate_lo_sum_address_p (mode, x, reg_ok_strict)) @@ -19011,7 +19011,7 @@ rs6000_secondary_reload_memory (rtx addr, plus_arg1 = XEXP (addr, 1); if (!base_reg_operand (reg, GET_MODE (reg)) || GET_CODE (plus_arg1) != PLUS - || !rtx_equal_p (reg, XEXP (plus_arg1, 0))) + || XEXP (plus_arg1, 0) != reg) { fail_msg = "bad PRE_MODIFY"; extra_cost = -1; @@ -19748,7 +19748,7 @@ rs6000_secondary_reload_inner (rtx reg, rtx mem, rtx scratch, bool store_p) op1 = XEXP (addr, 1); if (!base_reg_operand (op0, Pmode) || GET_CODE (op1) != PLUS - || !rtx_equal_p (op0, XEXP (op1, 0))) + || XEXP (op1, 0) != op0) rs6000_secondary_reload_fail (__LINE__, reg, mem, scratch, store_p); if ((addr_mask & RELOAD_REG_PRE_MODIFY) == 0) -- Alan Modra Australia Development Lab, IBM