if (else_bb)
fprintf (rtl_dump_file,
"\nIF-THEN-ELSE block found, start %d, then %d, else %d, join %d\n",
- test_bb->sindex, then_bb->sindex, else_bb->sindex,
- join_bb->sindex);
+ test_bb->index, then_bb->index, else_bb->index,
+ join_bb->index);
else
fprintf (rtl_dump_file,
"\nIF-THEN block found, start %d, then %d, join %d\n",
- test_bb->sindex, then_bb->sindex, join_bb->sindex);
+ test_bb->index, then_bb->index, join_bb->index);
}
/* Make sure IF, THEN, and ELSE, blocks are adjacent. Actually, we
if (rtl_dump_file)
{
fprintf (rtl_dump_file, "\nTRAP-IF block found, start %d, trap %d\n",
- test_bb->sindex, trap_bb->sindex);
+ test_bb->index, trap_bb->index);
}
/* If this is not a standard conditional jump, we can't parse it. */
basic_block then_bb = then_edge->dest;
basic_block else_bb = else_edge->dest, new_bb;
edge then_succ = then_bb->succ;
+ int then_bb_index;
/* THEN has one successor. */
if (!then_succ || then_succ->succ_next != NULL)
if (rtl_dump_file)
fprintf (rtl_dump_file,
"\nIF-CASE-1 found, start %d, then %d\n",
- test_bb->sindex, then_bb->sindex);
+ test_bb->index, then_bb->index);
/* THEN is small. */
if (count_bb_insns (then_bb) > BRANCH_COST)
then_bb->global_live_at_end, BITMAP_IOR);
new_bb = redirect_edge_and_branch_force (FALLTHRU_EDGE (test_bb), else_bb);
- /* Make rest of code believe that the newly created block is the THEN_BB
- block we are going to remove. */
+ then_bb_index = then_bb->index;
flow_delete_block (then_bb);
+ /* Make rest of code believe that the newly created block is the THEN_BB
+ block we removed. */
+ if (new_bb)
+ {
+ new_bb->index = then_bb_index;
+ BASIC_BLOCK (then_bb_index) = new_bb;
+ }
/* We've possibly created jump to next insn, cleanup_cfg will solve that
later. */
return FALSE;
/* THEN is not EXIT. */
- if (then_bb == EXIT_BLOCK_PTR)
+ if (then_bb->index < 0)
return FALSE;
/* ELSE is predicted or SUCC(ELSE) postdominates THEN. */
note = find_reg_note (test_bb->end, REG_BR_PROB, NULL_RTX);
if (note && INTVAL (XEXP (note, 0)) >= REG_BR_PROB_BASE / 2)
;
- else if (else_succ->dest == EXIT_BLOCK_PTR
- || TEST_BIT (post_dominators[then_bb->sindex],
- else_succ->dest->sindex))
+ else if (else_succ->dest->index < 0
+ || TEST_BIT (post_dominators[then_bb->index],
+ else_succ->dest->index))
;
else
return FALSE;
if (rtl_dump_file)
fprintf (rtl_dump_file,
"\nIF-CASE-2 found, start %d, else %d\n",
- test_bb->sindex, else_bb->sindex);
+ test_bb->index, else_bb->index);
/* ELSE is small. */
if (count_bb_insns (then_bb) > BRANCH_COST)
clear_bb_flags ();
/* Go through each of the basic blocks looking for things to convert. */
- FOR_ALL_BB (bb)
+ FOR_EACH_BB (bb)
while (find_if_header (bb))
- {
- }
+ continue;
if (post_dominators)
sbitmap_vector_free (post_dominators);