Commit d321bd2d by Eric Botcazou Committed by Eric Botcazou

ifcvt.c (noce_try_cmove_arith): Fix long lines.

	* ifcvt.c (noce_try_cmove_arith): Fix long lines.
	(check_cond_move_block): Likewise.
	(cond_move_process_if_block): Likewise.
	(noce_find_if_block): Improve formatting.
	(find_if_header): Pass 0 to memset and tweak conditions.
	(cond_exec_find_if_block): Fix long lines and tweak conditions.

From-SVN: r158529
parent 310e4472
2010-04-19 Eric Botcazou <ebotcazou@adacore.com>
* ifcvt.c (noce_try_cmove_arith): Fix long lines.
(check_cond_move_block): Likewise.
(cond_move_process_if_block): Likewise.
(noce_find_if_block): Improve formatting.
(find_if_header): Pass 0 to memset and tweak conditions.
(cond_exec_find_if_block): Fix long lines and tweak conditions.
2010-04-19 Jakub Jelinek <jakub@redhat.com> 2010-04-19 Jakub Jelinek <jakub@redhat.com>
* dwarf2out.c (lower_bound_default): For DW_LANG_Python return * dwarf2out.c (lower_bound_default): For DW_LANG_Python return
......
...@@ -1440,7 +1440,8 @@ noce_try_cmove_arith (struct noce_if_info *if_info) ...@@ -1440,7 +1440,8 @@ noce_try_cmove_arith (struct noce_if_info *if_info)
if insn_rtx_cost can't be estimated. */ if insn_rtx_cost can't be estimated. */
if (insn_a) if (insn_a)
{ {
insn_cost = insn_rtx_cost (PATTERN (insn_a), insn_cost
= insn_rtx_cost (PATTERN (insn_a),
optimize_bb_for_speed_p (BLOCK_FOR_INSN (insn_a))); optimize_bb_for_speed_p (BLOCK_FOR_INSN (insn_a)));
if (insn_cost == 0 || insn_cost > COSTS_N_INSNS (if_info->branch_cost)) if (insn_cost == 0 || insn_cost > COSTS_N_INSNS (if_info->branch_cost))
return FALSE; return FALSE;
...@@ -1450,7 +1451,8 @@ noce_try_cmove_arith (struct noce_if_info *if_info) ...@@ -1450,7 +1451,8 @@ noce_try_cmove_arith (struct noce_if_info *if_info)
if (insn_b) if (insn_b)
{ {
insn_cost += insn_rtx_cost (PATTERN (insn_b), insn_cost
+= insn_rtx_cost (PATTERN (insn_b),
optimize_bb_for_speed_p (BLOCK_FOR_INSN (insn_b))); optimize_bb_for_speed_p (BLOCK_FOR_INSN (insn_b)));
if (insn_cost == 0 || insn_cost > COSTS_N_INSNS (if_info->branch_cost)) if (insn_cost == 0 || insn_cost > COSTS_N_INSNS (if_info->branch_cost))
return FALSE; return FALSE;
...@@ -2579,7 +2581,8 @@ noce_process_if_block (struct noce_if_info *if_info) ...@@ -2579,7 +2581,8 @@ noce_process_if_block (struct noce_if_info *if_info)
REGS. COND is the condition we will test. */ REGS. COND is the condition we will test. */
static int static int
check_cond_move_block (basic_block bb, rtx *vals, VEC (int, heap) **regs, rtx cond) check_cond_move_block (basic_block bb, rtx *vals, VEC (int, heap) **regs,
rtx cond)
{ {
rtx insn; rtx insn;
...@@ -2743,7 +2746,8 @@ cond_move_process_if_block (struct noce_if_info *if_info) ...@@ -2743,7 +2746,8 @@ cond_move_process_if_block (struct noce_if_info *if_info)
/* Make sure the blocks are suitable. */ /* Make sure the blocks are suitable. */
if (!check_cond_move_block (then_bb, then_vals, &then_regs, cond) if (!check_cond_move_block (then_bb, then_vals, &then_regs, cond)
|| (else_bb && !check_cond_move_block (else_bb, else_vals, &else_regs, cond))) || (else_bb
&& !check_cond_move_block (else_bb, else_vals, &else_regs, cond)))
{ {
VEC_free (int, heap, then_regs); VEC_free (int, heap, then_regs);
VEC_free (int, heap, else_regs); VEC_free (int, heap, else_regs);
...@@ -2859,8 +2863,7 @@ cond_move_process_if_block (struct noce_if_info *if_info) ...@@ -2859,8 +2863,7 @@ cond_move_process_if_block (struct noce_if_info *if_info)
Return TRUE if we were successful at converting the block. */ Return TRUE if we were successful at converting the block. */
static int static int
noce_find_if_block (basic_block test_bb, noce_find_if_block (basic_block test_bb, edge then_edge, edge else_edge,
edge then_edge, edge else_edge,
int pass) int pass)
{ {
basic_block then_bb, else_bb, join_bb; basic_block then_bb, else_bb, join_bb;
...@@ -2941,9 +2944,7 @@ noce_find_if_block (basic_block test_bb, ...@@ -2941,9 +2944,7 @@ noce_find_if_block (basic_block test_bb,
return FALSE; return FALSE;
/* If this is not a standard conditional jump, we can't parse it. */ /* If this is not a standard conditional jump, we can't parse it. */
cond = noce_get_condition (jump, cond = noce_get_condition (jump, &cond_earliest, then_else_reversed);
&cond_earliest,
then_else_reversed);
if (!cond) if (!cond)
return FALSE; return FALSE;
...@@ -3135,7 +3136,7 @@ find_if_header (basic_block test_bb, int pass) ...@@ -3135,7 +3136,7 @@ find_if_header (basic_block test_bb, int pass)
/* Otherwise this must be a multiway branch of some sort. */ /* Otherwise this must be a multiway branch of some sort. */
return NULL; return NULL;
memset (&ce_info, '\0', sizeof (ce_info)); memset (&ce_info, 0, sizeof (ce_info));
ce_info.test_bb = test_bb; ce_info.test_bb = test_bb;
ce_info.then_bb = then_edge->dest; ce_info.then_bb = then_edge->dest;
ce_info.else_bb = else_edge->dest; ce_info.else_bb = else_edge->dest;
...@@ -3145,11 +3146,12 @@ find_if_header (basic_block test_bb, int pass) ...@@ -3145,11 +3146,12 @@ find_if_header (basic_block test_bb, int pass)
IFCVT_INIT_EXTRA_FIELDS (&ce_info); IFCVT_INIT_EXTRA_FIELDS (&ce_info);
#endif #endif
if (! reload_completed if (!reload_completed
&& noce_find_if_block (test_bb, then_edge, else_edge, pass)) && noce_find_if_block (test_bb, then_edge, else_edge, pass))
goto success; goto success;
if (targetm.have_conditional_execution () && reload_completed if (reload_completed
&& targetm.have_conditional_execution ()
&& cond_exec_find_if_block (&ce_info)) && cond_exec_find_if_block (&ce_info))
goto success; goto success;
...@@ -3159,7 +3161,7 @@ find_if_header (basic_block test_bb, int pass) ...@@ -3159,7 +3161,7 @@ find_if_header (basic_block test_bb, int pass)
goto success; goto success;
if (dom_info_state (CDI_POST_DOMINATORS) >= DOM_NO_FAST_QUERY if (dom_info_state (CDI_POST_DOMINATORS) >= DOM_NO_FAST_QUERY
&& (! targetm.have_conditional_execution () || reload_completed)) && (reload_completed || !targetm.have_conditional_execution ()))
{ {
if (find_if_case_1 (test_bb, then_edge, else_edge)) if (find_if_case_1 (test_bb, then_edge, else_edge))
goto success; goto success;
...@@ -3265,8 +3267,8 @@ cond_exec_find_if_block (struct ce_if_block * ce_info) ...@@ -3265,8 +3267,8 @@ cond_exec_find_if_block (struct ce_if_block * ce_info)
ce_info->last_test_bb = test_bb; ce_info->last_test_bb = test_bb;
/* We only ever should get here after reload, /* We only ever should get here after reload,
and only if we have conditional execution. */ and if we have conditional execution. */
gcc_assert (targetm.have_conditional_execution () && reload_completed); gcc_assert (reload_completed && targetm.have_conditional_execution ());
/* Discover if any fall through predecessors of the current test basic block /* Discover if any fall through predecessors of the current test basic block
were && tests (which jump to the else block) or || tests (which jump to were && tests (which jump to the else block) or || tests (which jump to
...@@ -3347,7 +3349,8 @@ cond_exec_find_if_block (struct ce_if_block * ce_info) ...@@ -3347,7 +3349,8 @@ cond_exec_find_if_block (struct ce_if_block * ce_info)
if (EDGE_COUNT (then_bb->succs) > 0 if (EDGE_COUNT (then_bb->succs) > 0
&& (!single_succ_p (then_bb) && (!single_succ_p (then_bb)
|| (single_succ_edge (then_bb)->flags & EDGE_COMPLEX) || (single_succ_edge (then_bb)->flags & EDGE_COMPLEX)
|| (epilogue_completed && tablejump_p (BB_END (then_bb), NULL, NULL)))) || (epilogue_completed
&& tablejump_p (BB_END (then_bb), NULL, NULL))))
return FALSE; return FALSE;
/* If the THEN block has no successors, conditional execution can still /* If the THEN block has no successors, conditional execution can still
...@@ -3393,8 +3396,9 @@ cond_exec_find_if_block (struct ce_if_block * ce_info) ...@@ -3393,8 +3396,9 @@ cond_exec_find_if_block (struct ce_if_block * ce_info)
else if (single_succ_p (else_bb) else if (single_succ_p (else_bb)
&& single_succ (then_bb) == single_succ (else_bb) && single_succ (then_bb) == single_succ (else_bb)
&& single_pred_p (else_bb) && single_pred_p (else_bb)
&& ! (single_succ_edge (else_bb)->flags & EDGE_COMPLEX) && !(single_succ_edge (else_bb)->flags & EDGE_COMPLEX)
&& ! (epilogue_completed && tablejump_p (BB_END (else_bb), NULL, NULL))) && !(epilogue_completed
&& tablejump_p (BB_END (else_bb), NULL, NULL)))
join_bb = single_succ (else_bb); join_bb = single_succ (else_bb);
/* Otherwise it is not an IF-THEN or IF-THEN-ELSE combination. */ /* Otherwise it is not an IF-THEN or IF-THEN-ELSE combination. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment