summaryrefslogtreecommitdiff
path: root/gcc/ifcvt.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@cygnus.com>2000-05-12 09:26:15 -0700
committerRichard Henderson <rth@gcc.gnu.org>2000-05-12 09:26:15 -0700
commitbe1bb652637d5d8785993a4cd197d989dc4b5260 (patch)
treed0c01aedfa0c100dbc8cf6e908311acdea960127 /gcc/ifcvt.c
parentfb0f12c9326308579f89b0961681ffdb85288228 (diff)
downloadgcc-be1bb652637d5d8785993a4cd197d989dc4b5260.tar.gz
Makefile.in (final.o): Depend on BASIC_BLOCK_H.
* Makefile.in (final.o): Depend on BASIC_BLOCK_H. * final.c (final_end_function): Use app_disable. Rearrange note handling into a switch. Emit deleted labels. (output_asm_label): Generate label strings for deleted labels. * flow.c (tail_recursion_label_list): New. (find_basic_blocks_1): Set label_value_list directly. Collect list of tail recursion labels from call_placeholders. Don't add deleted labels to the label value list. (cleanup_cfg): Use free_EXPR_LIST_list. (flow_delete_insn_chain): Turn non-removable labels into notes. (flow_delete_block): Don't disable deleting the block because of a non-removable label. (tail_recursion_label_p): New. (merge_blocks_move_predecessor_nojumps): Don't disable the merge because of a label. (merge_blocks_move_successor_nojumps): Likewise. Also move a jump table. (merge_blocks): Disable a merge because of tail recursion labels. * ifcvt.c (merge_if_block): Don't disable a merge because of a label. Use a more accurate measure of not merging the join block. (find_if_block): Don't disable conversion because of a label. (find_if_case_1, find_if_case_2): Likewise. * jump.c (duplicate_loop_exit_test): Preserve the kind of list element when copying. (squeeze_notes): Also leave EH notes. (mark_jump_label): Ignore deleted labels. Use an INSN_LIST for REG_LABEL notes. (delete_insn): Preserve LABEL_NAME in NOTE_SOURCE_FILE when deleting a label. * print-rtl.c (print_rtx): Print NOTE_SOURCE_FILE for NOTE_INSN_DELETED_LABEL. Print `[# deleted]' for a label_ref referring to a deleted label. Convert tail handling to a switch. * rtl.def (CODE_LABEL): Rearrange elements to be compatible with NOTE for NOTE_INSN_DELETED_LABEL. (NOTE): Fix commentary. * rtl.h (REG_LABEL): Update commentary wrt INSN_LIST. (REG_CC_SETTER, REG_CC_USER, REG_LIBCALL): Likewise. (CODE_LABEL_NUMBER, LABEL_NAME): Update index. (LABEL_NUSES, LABEL_REFS): Likewise. * unroll.c (copy_loop_body): Don't copy NOTE_INSN_DELETED_LABEL. From-SVN: r33876
Diffstat (limited to 'gcc/ifcvt.c')
-rw-r--r--gcc/ifcvt.c59
1 files changed, 7 insertions, 52 deletions
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index 8c2ddee0fbf..aa54390e73a 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -1275,37 +1275,8 @@ merge_if_block (test_bb, then_bb, else_bb, join_bb)
get their addresses taken. */
if (else_bb)
{
- if (LABEL_NUSES (else_bb->head) == 0
- && ! LABEL_PRESERVE_P (else_bb->head)
- && ! LABEL_NAME (else_bb->head))
- {
- /* We can merge the ELSE. */
- merge_blocks_nomove (combo_bb, else_bb);
- num_removed_blocks++;
- }
- else
- {
- /* We cannot merge the ELSE. */
-
- /* Properly rewire the edge out of the now combined
- TEST-THEN block to point here. */
- remove_edge (combo_bb->succ);
- if (combo_bb->succ || else_bb->pred)
- abort ();
- make_edge (NULL, combo_bb, else_bb, EDGE_FALLTHRU);
-
- /* Remove the jump and cruft from the end of the TEST-THEN block. */
- tidy_fallthru_edge (combo_bb->succ, combo_bb, else_bb);
-
- /* Make sure we update life info properly. */
- SET_UPDATE_LIFE(combo_bb);
- if (else_bb->global_live_at_end)
- COPY_REG_SET (else_bb->global_live_at_start,
- else_bb->global_live_at_end);
-
- /* The ELSE is the new combo block. */
- combo_bb = else_bb;
- }
+ merge_blocks_nomove (combo_bb, else_bb);
+ num_removed_blocks++;
}
/* If there was no join block reported, that means it was not adjacent
@@ -1325,12 +1296,11 @@ merge_if_block (test_bb, then_bb, else_bb, join_bb)
abort ();
}
- /* The JOIN block had a label. It may have had quite a number
- of other predecessors too, but probably not. See if we can
- merge this with the others. */
- else if (LABEL_NUSES (join_bb->head) == 0
- && ! LABEL_PRESERVE_P (join_bb->head)
- && ! LABEL_NAME (join_bb->head))
+ /* The JOIN block may have had quite a number of other predecessors too.
+ Since we've already merged the TEST, THEN and ELSE blocks, we should
+ have only one remaining edge from our if-then-else diamond. If there
+ is more than one remaining edge, it must come from elsewhere. */
+ else if (join_bb->pred->pred_next == NULL)
{
/* We can merge the JOIN. */
if (combo_bb->global_live_at_end)
@@ -1438,11 +1408,6 @@ find_if_block (test_bb, then_edge, else_edge)
|| (then_succ->flags & EDGE_COMPLEX))
return FALSE;
- /* The THEN block may not start with a label, as might happen with an
- unused user label that has had its address taken. */
- if (GET_CODE (then_bb->head) == CODE_LABEL)
- return FALSE;
-
/* If the THEN block's successor is the other edge out of the TEST block,
then we have an IF-THEN combo without an ELSE. */
if (then_succ->dest == else_bb)
@@ -1600,10 +1565,6 @@ find_if_case_1 (test_bb, then_edge, else_edge)
if (then_bb->pred->pred_next != NULL)
return FALSE;
- /* THEN has no label. */
- if (GET_CODE (then_bb->head) == CODE_LABEL)
- return FALSE;
-
/* ELSE follows THEN. (??? could be moved) */
if (else_bb->index != then_bb->index + 1)
return FALSE;
@@ -1674,12 +1635,6 @@ find_if_case_2 (test_bb, then_edge, else_edge)
if (else_bb->pred->pred_next != NULL)
return FALSE;
- /* ELSE has a label we can delete. */
- if (LABEL_NUSES (else_bb->head) > 1
- || LABEL_PRESERVE_P (else_bb->head)
- || LABEL_NAME (else_bb->head))
- 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)