@@ -811,9 +811,6 @@ struct noce_if_info
unsigned int then_cost;
unsigned int else_cost;
- /* Estimated cost of the particular branch instruction. */
- unsigned int branch_cost;
-
/* Maximum permissible cost for the unconditional sequence we should
generate to replace this branch. */
unsigned int max_seq_cost;
@@ -1683,7 +1680,8 @@ noce_try_store_flag_mask (struct noce_if_info *if_info)
speed_p = optimize_bb_for_speed_p (BLOCK_FOR_INSN (if_info->insn_a));
insn_cost = insn_rtx_cost (PATTERN (if_info->insn_a), speed_p);
- old_cost = COSTS_N_INSNS (if_info->branch_cost) + insn_cost;
+ /* TODO: Revisit this cost model. */
+ old_cost = if_info->max_seq_cost + insn_cost;
new_cost = seq_cost (seq, speed_p);
if (new_cost > old_cost)
@@ -2159,7 +2157,9 @@ noce_try_cmove_arith (struct noce_if_info *if_info)
/* We're going to execute one of the basic blocks anyway, so
bail out if the most expensive of the two blocks is unacceptable. */
- if (MAX (then_cost, else_cost) > COSTS_N_INSNS (if_info->branch_cost))
+
+ /* TODO: Revisit cost model. */
+ if (MAX (then_cost, else_cost) > if_info->max_seq_cost)
return FALSE;
/* Possibly rearrange operands to make things come out more natural. */
@@ -3341,8 +3341,8 @@ noce_convert_multiple_sets (struct noce_if_info *if_info)
of conditional moves. FORNOW: Use II to find the expected cost of
the branch into/over TEST_BB.
- TODO: This creates an implicit "magic number" for branch_cost.
- II->branch_cost now guides the maximum number of set instructions in
+ TODO: This creates an implicit "magic number" for if conversion.
+ II->max_seq_cost now guides the maximum number of set instructions in
a basic block which is considered profitable to completely
if-convert. */
@@ -3353,7 +3353,8 @@ bb_ok_for_noce_convert_multiple_sets (basic_block test_bb,
rtx_insn *insn;
unsigned count = 0;
unsigned param = PARAM_VALUE (PARAM_MAX_RTL_IF_CONVERSION_INSNS);
- unsigned limit = MIN (ii->branch_cost, param);
+ /* TODO: Revisit this cost model. */
+ unsigned limit = MIN (ii->max_seq_cost / COSTS_N_INSNS (1), param);
FOR_BB_INSNS (test_bb, insn)
{
@@ -4070,8 +4071,6 @@ noce_find_if_block (basic_block test_bb, edge then_edge, edge else_edge,
if_info.cond_earliest = cond_earliest;
if_info.jump = jump;
if_info.then_else_reversed = then_else_reversed;
- if_info.branch_cost = BRANCH_COST (optimize_bb_for_speed_p (test_bb),
- predictable_edge_p (then_edge));
if_info.max_seq_cost
= targetm.max_noce_ifcvt_seq_cost (optimize_bb_for_speed_p (test_bb),
then_edge);