From 5e8f01f434e547d21e6be3f44b2f5d9090fdc9db Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Thu, 18 Aug 2011 12:37:27 +0000 Subject: rtl.h (set_src_cost, [...]): New functions. gcc/ * rtl.h (set_src_cost, get_full_set_src_cost): New functions. * auto-inc-dec.c (attempt_change): Use set_src_cost instead of rtx_cost. * calls.c (precompute_register_parameters): Likewise. * combine.c (expand_compound_operation, make_extraction): Likewise. (force_to_mode, distribute_and_simplify_rtx): Likewise. * dse.c (find_shift_sequence): Likewise. * expmed.c (init_expmed, expand_mult, expand_smod_pow2): Likewise. * expr.c (compress_float_constant): Likewise. * fwprop.c (should_replace_address, try_fwprop_subst): Likewise. * gcse.c (want_to_gcse_p): Likewise. * ifcvt.c (noce_try_sign_mask): Likewise. * loop-doloop.c (doloop_optimize): Likewise. * loop-invariant.c (create_new_invariant): Likewise. * optabs.c (avoid_expensive_constant): Likewise. * postreload.c (reload_cse_simplify_set, reload_cse_simplify_operands) (try_replace_in_use, reload_cse_move2add): Likewise. * reload1.c (calculate_elim_costs_all_insns): Likewise. (note_reg_elim_costly): Likewise. * rtlanal.c (insn_rtx_cost): Likewise. * simplify-rtx.c (simplify_binary_operation_1): Likewise. * stmt.c (lshift_cheap_p): Likewise. * tree-ssa-loop-ivopts.c (seq_cost, computation_cost): Likewise. * config/avr/avr.c (final_prescan_insn): Likewise. * config/bfin/bfin.c (bfin_rtx_costs): Likewise. * config/mips/mips.c (mips_binary_cost, mips_rtx_costs): Likewise. From-SVN: r177851 --- gcc/postreload.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'gcc/postreload.c') diff --git a/gcc/postreload.c b/gcc/postreload.c index 88b401f..0e50d85 100644 --- a/gcc/postreload.c +++ b/gcc/postreload.c @@ -275,7 +275,7 @@ reload_cse_simplify_set (rtx set, rtx insn) old_cost = register_move_cost (GET_MODE (src), REGNO_REG_CLASS (REGNO (src)), dclass); else - old_cost = rtx_cost (src, SET, speed); + old_cost = set_src_cost (src, speed); for (l = val->locs; l; l = l->next) { @@ -310,7 +310,7 @@ reload_cse_simplify_set (rtx set, rtx insn) this_rtx = GEN_INT (this_val); } #endif - this_cost = rtx_cost (this_rtx, SET, speed); + this_cost = set_src_cost (this_rtx, speed); } else if (REG_P (this_rtx)) { @@ -318,7 +318,7 @@ reload_cse_simplify_set (rtx set, rtx insn) if (extend_op != UNKNOWN) { this_rtx = gen_rtx_fmt_e (extend_op, word_mode, this_rtx); - this_cost = rtx_cost (this_rtx, SET, speed); + this_cost = set_src_cost (this_rtx, speed); } else #endif @@ -579,10 +579,12 @@ reload_cse_simplify_operands (rtx insn, rtx testreg) && recog_data.alternative_enabled_p[j] && reg_fits_class_p (testreg, rclass, 0, mode) && (!CONST_INT_P (recog_data.operand[i]) - || (rtx_cost (recog_data.operand[i], SET, - optimize_bb_for_speed_p (BLOCK_FOR_INSN (insn))) - > rtx_cost (testreg, SET, - optimize_bb_for_speed_p (BLOCK_FOR_INSN (insn)))))) + || (set_src_cost (recog_data.operand[i], + optimize_bb_for_speed_p + (BLOCK_FOR_INSN (insn))) + > set_src_cost (testreg, + optimize_bb_for_speed_p + (BLOCK_FOR_INSN (insn)))))) { alternative_nregs[j]++; op_alt_regno[i][j] = regno; @@ -916,12 +918,12 @@ try_replace_in_use (struct reg_use *use, rtx reg, rtx src) && CONSTANT_P (XEXP (SET_SRC (new_set), 1))) { rtx new_src; - int old_cost = rtx_cost (SET_SRC (new_set), SET, speed); + int old_cost = set_src_cost (SET_SRC (new_set), speed); gcc_assert (rtx_equal_p (XEXP (SET_SRC (new_set), 0), reg)); new_src = simplify_replace_rtx (SET_SRC (new_set), reg, src); - if (rtx_cost (new_src, SET, speed) <= old_cost + if (set_src_cost (new_src, speed) <= old_cost && validate_change (use_insn, &SET_SRC (new_set), new_src, 0)) return true; @@ -1936,7 +1938,7 @@ reload_cse_move2add (rtx first) get_full_set_rtx_cost (set, &oldcst); SET_SRC (set) = tem; - get_full_rtx_cost (tem, SET, &newcst); + get_full_set_src_cost (tem, &newcst); SET_SRC (set) = old_src; costs_add_n_insns (&oldcst, 1); -- cgit v1.1