summaryrefslogtreecommitdiff
path: root/gcc/reload1.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2001-09-25 15:26:55 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2001-09-25 15:26:55 +0000
commitb36d64df6599305501a54336c259d2c252a5f532 (patch)
treec24462f2a137fa697fa16cd37b541df560a461cf /gcc/reload1.c
parent065ea2c9307bb8e11efefa2ff5a0f75b76c4249a (diff)
downloadgcc-b36d64df6599305501a54336c259d2c252a5f532.tar.gz
* Makefile.in (cfgrtl.o): Add.
* basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): Declare. * cfg.c (HAVE_return): Undefine. * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, free_aux_for_edge): New global functions. (first_delete_block): New static variable. (init_flow): Clear first_delete_block. (basic_block_for_insn, label_value_list, tail_recursion_label_list, can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, try_redirect_by_replacing_jump, last_loop_beg_note, back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, delete_insn, delete_insn_chain, create_basic_block_structure, create_basic_block, flow_delete_block, compute_bb_for_insn, free_bb_for_insn, update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, split_block, merge_blocks_nomove, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_edge_and_branch, force_nonfallthru_and_redirect, force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, tidy_fallthru_edges, split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, purge_all_dead_edges): Move to .... * cfgrtl.c: New file; .... Here. * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. (reroder_basic_block): Use alloc_aux_for_blocks. * predict.c (estimate_bb_frequencies): Likewise; use alloc_aux_for_edges. * profile.c (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * reg-stack.c (reg_to_stack): Likewise. * emit-rtl.c (emit_insns_after): Never return NULL. * basic-block.h (set_block_for_new_insns): Delete. * cfgrtl.c (set_block_for_new_insns): Delete. * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn calls when crossjumping. * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. * unroll.c (copy_loop_body): Use delete_insn. * final.c (final, final_scan_insn): Use delete_insn/delete_note. * function.c (fixup_var_refs_insn, fixup_var_refs_1, keep_stack_depressed): Likewise. * gcse.c (cprop_cc0_jump): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop.c (scan_loop, loop_delete_insns): Likewise. * regmove.c (try_auto_increment, fixup_match_1): Likewise. * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, delete_output_reload, delete_address_reloads_1, reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): Likewise. * sibcall.c (replace_call_placeholder): Likewise. * cse.c (cse_insn): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45807 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/reload1.c')
-rw-r--r--gcc/reload1.c74
1 files changed, 14 insertions, 60 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 9ba07355a8b..820843257a2 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -1263,7 +1263,6 @@ reload (first, global)
/* Free all the insn_chain structures at once. */
obstack_free (&reload_obstack, reload_startobj);
unused_insn_chains = 0;
- compute_bb_for_insn (get_max_uid ());
fixup_abnormal_edges ();
return failure;
@@ -1465,9 +1464,7 @@ calculate_needs_all_insns (global)
&& GET_CODE (SET_SRC (set)) == REG
&& REGNO (SET_SRC (set)) >= FIRST_PSEUDO_REGISTER)
{
- PUT_CODE (insn, NOTE);
- NOTE_SOURCE_FILE (insn) = 0;
- NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
+ delete_insn (insn);
/* Delete it from the reload chain */
if (chain->prev)
chain->prev->next = next;
@@ -1851,17 +1848,9 @@ delete_caller_save_insns ()
struct insn_chain *next = c->next;
rtx insn = c->insn;
- if (insn == BLOCK_HEAD (c->block))
- BLOCK_HEAD (c->block) = NEXT_INSN (insn);
- if (insn == BLOCK_END (c->block))
- BLOCK_END (c->block) = PREV_INSN (insn);
if (c == reload_insn_chain)
reload_insn_chain = next;
-
- if (NEXT_INSN (insn) != 0)
- PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn);
- if (PREV_INSN (insn) != 0)
- NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn);
+ delete_insn (insn);
if (next)
next->prev = c->prev;
@@ -3908,9 +3897,7 @@ reload_as_needed (live_known)
{
error_for_asm (insn,
"`asm' operand requires impossible reload");
- PUT_CODE (p, NOTE);
- NOTE_SOURCE_FILE (p) = 0;
- NOTE_LINE_NUMBER (p) = NOTE_INSN_DELETED;
+ delete_insn (p);
}
}
@@ -6941,8 +6928,6 @@ emit_reload_insns (chain)
rtx insn = chain->insn;
register int j;
- rtx following_insn = NEXT_INSN (insn);
- rtx before_insn = PREV_INSN (insn);
CLEAR_HARD_REG_SET (reg_reloaded_died);
@@ -7018,19 +7003,10 @@ emit_reload_insns (chain)
for (j = 0; j < reload_n_operands; j++)
{
- emit_insns_before (outaddr_address_reload_insns[j], following_insn);
- emit_insns_before (output_address_reload_insns[j], following_insn);
- emit_insns_before (output_reload_insns[j], following_insn);
- emit_insns_before (other_output_reload_insns[j], following_insn);
- }
-
- /* Keep basic block info up to date. */
- if (n_basic_blocks)
- {
- if (BLOCK_HEAD (chain->block) == insn)
- BLOCK_HEAD (chain->block) = NEXT_INSN (before_insn);
- if (BLOCK_END (chain->block) == insn)
- BLOCK_END (chain->block) = PREV_INSN (following_insn);
+ rtx x = emit_insns_after (outaddr_address_reload_insns[j], insn);
+ x = emit_insns_after (output_address_reload_insns[j], x);
+ x = emit_insns_after (output_reload_insns[j], x);
+ emit_insns_after (other_output_reload_insns[j], x);
}
/* For all the spill regs newly reloaded in this instruction,
@@ -7669,9 +7645,7 @@ delete_output_reload (insn, j, last_reload_reg)
/* Some other ref remains; just delete the output reload we
know to be dead. */
delete_address_reloads (output_reload_insn, insn);
- PUT_CODE (output_reload_insn, NOTE);
- NOTE_SOURCE_FILE (output_reload_insn) = 0;
- NOTE_LINE_NUMBER (output_reload_insn) = NOTE_INSN_DELETED;
+ delete_insn (output_reload_insn);
return;
}
}
@@ -7686,9 +7660,7 @@ delete_output_reload (insn, j, last_reload_reg)
delete_address_reloads (i2, insn);
/* This might be a basic block head,
thus don't use delete_insn. */
- PUT_CODE (i2, NOTE);
- NOTE_SOURCE_FILE (i2) = 0;
- NOTE_LINE_NUMBER (i2) = NOTE_INSN_DELETED;
+ delete_insn (i2);
}
if (GET_CODE (i2) == CODE_LABEL
|| GET_CODE (i2) == JUMP_INSN)
@@ -7701,9 +7673,7 @@ delete_output_reload (insn, j, last_reload_reg)
alter_reg (REGNO (reg), -1);
}
delete_address_reloads (output_reload_insn, insn);
- PUT_CODE (output_reload_insn, NOTE);
- NOTE_SOURCE_FILE (output_reload_insn) = 0;
- NOTE_LINE_NUMBER (output_reload_insn) = NOTE_INSN_DELETED;
+ delete_insn (output_reload_insn);
}
@@ -7852,10 +7822,7 @@ delete_address_reloads_1 (dead_insn, x, current_insn)
}
delete_address_reloads_1 (prev, SET_SRC (set), current_insn);
reg_reloaded_contents[REGNO (dst)] = -1;
- /* Can't use delete_insn here because PREV might be a basic block head. */
- PUT_CODE (prev, NOTE);
- NOTE_LINE_NUMBER (prev) = NOTE_INSN_DELETED;
- NOTE_SOURCE_FILE (prev) = 0;
+ delete_insn (prev);
}
/* Output reload-insns to reload VALUE into RELOADREG.
@@ -8026,11 +7993,7 @@ reload_cse_delete_noop_set (insn, value)
REG_NOTES (insn) = NULL_RTX;
}
else
- {
- PUT_CODE (insn, NOTE);
- NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
- NOTE_SOURCE_FILE (insn) = 0;
- }
+ delete_insn (insn);
}
/* See whether a single set SET is a noop. */
@@ -8782,9 +8745,7 @@ reload_combine ()
rtx *np;
/* Delete the reg-reg addition. */
- PUT_CODE (insn, NOTE);
- NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
- NOTE_SOURCE_FILE (insn) = 0;
+ delete_insn (insn);
if (reg_state[regno].offset != const0_rtx)
/* Previous REG_EQUIV / REG_EQUAL notes for PREV
@@ -9226,14 +9187,7 @@ reload_cse_move2add (first)
= validate_change (next, &PATTERN (next),
gen_add2_insn (reg, new_src), 0);
if (success)
- {
- /* INSN might be the first insn in a basic block
- if the preceding insn is a conditional jump
- or a possible-throwing call. */
- PUT_CODE (insn, NOTE);
- NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
- NOTE_SOURCE_FILE (insn) = 0;
- }
+ delete_insn (insn);
insn = next;
reg_mode[regno] = GET_MODE (reg);
reg_offset[regno] = sext_for_mode (GET_MODE (reg),