Makefile.in (cfgrtl.o): Add.
* 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. From-SVN: r45807
This commit is contained in:
parent
21e1b5f1e0
commit
ca6c03cabd
|
@ -1,3 +1,66 @@
|
|||
Tue Sep 25 17:13:56 CEST 2001 Jan Hubicka <jh@suse.cz>
|
||||
|
||||
* 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.
|
||||
|
||||
2001-09-25 Bernd Schmidt <bernds@redhat.com>
|
||||
|
||||
From Graham Stott <grahams@redhat.com>
|
||||
|
|
|
@ -747,7 +747,7 @@ OBJS = \
|
|||
sdbout.o sibcall.o simplify-rtx.o splay-tree.o ssa.o ssa-ccp.o \
|
||||
ssa-dce.o stmt.o stor-layout.o stringpool.o timevar.o toplev.o tree.o \
|
||||
unroll.o varasm.o varray.o version.o xcoffout.o cfg.o cfganal.o \
|
||||
cfgbuild.o cfgcleanup.o cfgloop.o \
|
||||
cfgbuild.o cfgcleanup.o cfgloop.o cfgrtl.o \
|
||||
$(GGC) $(out_object_file) $(EXTRA_OBJS)
|
||||
|
||||
BACKEND = main.o libbackend.a
|
||||
|
@ -1497,6 +1497,9 @@ flow.o : flow.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h insn-config.h
|
|||
cfg.o : cfg.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h insn-config.h \
|
||||
$(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \
|
||||
function.h except.h $(GGC_H) $(TM_P_H)
|
||||
cfgrtl.o : cfgrtl.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h insn-config.h \
|
||||
$(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \
|
||||
function.h except.h $(GGC_H) $(TM_P_H)
|
||||
cfganal.o : cfganal.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
|
||||
$(BASIC_BLOCK_H) hard-reg-set.h $(GGC_H)
|
||||
cfgbuild.o : cfgbuild.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h insn-config.h \
|
||||
|
|
|
@ -291,7 +291,6 @@ extern void compute_bb_for_insn PARAMS ((int));
|
|||
extern void free_bb_for_insn PARAMS ((void));
|
||||
extern void update_bb_for_insn PARAMS ((basic_block));
|
||||
extern void set_block_for_insn PARAMS ((rtx, basic_block));
|
||||
extern void set_block_for_new_insns PARAMS ((rtx, basic_block));
|
||||
|
||||
extern void free_basic_block_vars PARAMS ((int));
|
||||
|
||||
|
@ -630,6 +629,7 @@ extern void debug_regset PARAMS ((regset));
|
|||
extern void allocate_reg_life_data PARAMS ((void));
|
||||
extern void allocate_bb_life_data PARAMS ((void));
|
||||
extern void expunge_block PARAMS ((basic_block));
|
||||
extern basic_block alloc_block PARAMS ((void));
|
||||
extern void find_unreachable_blocks PARAMS ((void));
|
||||
extern void delete_noop_moves PARAMS ((rtx));
|
||||
extern basic_block redirect_edge_and_branch_force PARAMS ((edge, basic_block));
|
||||
|
@ -645,6 +645,12 @@ extern void flow_nodes_print PARAMS ((const char *, const sbitmap,
|
|||
FILE *));
|
||||
extern void flow_edge_list_print PARAMS ((const char *, const edge *,
|
||||
int, FILE *));
|
||||
extern void alloc_aux_for_block PARAMS ((basic_block, int));
|
||||
extern void alloc_aux_for_blocks PARAMS ((int));
|
||||
extern void free_aux_for_blocks PARAMS ((void));
|
||||
extern void alloc_aux_for_edge PARAMS ((edge, int));
|
||||
extern void alloc_aux_for_edges PARAMS ((int));
|
||||
extern void free_aux_for_edges PARAMS ((void));
|
||||
|
||||
/* This function is always defined so it can be called from the
|
||||
debugger, and it is declared extern so we don't get warnings about
|
||||
|
|
|
@ -660,7 +660,7 @@ fixup_reorder_chain ()
|
|||
|
||||
if (nb)
|
||||
{
|
||||
nb->aux = xmalloc (sizeof (struct reorder_block_def));
|
||||
alloc_aux_for_block (nb, sizeof (struct reorder_block_def));
|
||||
RBI (nb)->eff_head = nb->head;
|
||||
RBI (nb)->eff_end = NEXT_INSN (nb->end);
|
||||
RBI (nb)->scope = RBI (bb)->scope;
|
||||
|
@ -1327,15 +1327,11 @@ void
|
|||
reorder_basic_blocks ()
|
||||
{
|
||||
scope_forest_info forest;
|
||||
int i;
|
||||
|
||||
if (n_basic_blocks <= 1)
|
||||
return;
|
||||
|
||||
for (i = 0; i < n_basic_blocks; i++)
|
||||
BASIC_BLOCK (i)->aux = xcalloc (1, sizeof (struct reorder_block_def));
|
||||
|
||||
EXIT_BLOCK_PTR->aux = xcalloc (1, sizeof (struct reorder_block_def));
|
||||
alloc_aux_for_blocks (sizeof (struct reorder_block_def));
|
||||
|
||||
build_scope_forest (&forest);
|
||||
remove_scope_notes ();
|
||||
|
@ -1356,10 +1352,7 @@ reorder_basic_blocks ()
|
|||
free_scope_forest (&forest);
|
||||
reorder_blocks ();
|
||||
|
||||
for (i = 0; i < n_basic_blocks; i++)
|
||||
free (BASIC_BLOCK (i)->aux);
|
||||
|
||||
free (EXIT_BLOCK_PTR->aux);
|
||||
free_aux_for_blocks ();
|
||||
|
||||
#ifdef ENABLE_CHECKING
|
||||
verify_flow_info ();
|
||||
|
|
|
@ -106,14 +106,9 @@ try_simplify_condjump (cbranch_block)
|
|||
if (!can_fallthru (jump_block, cbranch_dest_block))
|
||||
return false;
|
||||
|
||||
/* Invert the conditional branch. Prevent jump.c from deleting
|
||||
"unreachable" instructions. */
|
||||
LABEL_NUSES (JUMP_LABEL (cbranch_insn))++;
|
||||
if (!invert_jump (cbranch_insn, block_label (jump_dest_block), 1))
|
||||
{
|
||||
LABEL_NUSES (JUMP_LABEL (cbranch_insn))--;
|
||||
return false;
|
||||
}
|
||||
/* Invert the conditional branch. */
|
||||
if (!invert_jump (cbranch_insn, block_label (jump_dest_block), 0))
|
||||
return false;
|
||||
|
||||
if (rtl_dump_file)
|
||||
fprintf (rtl_dump_file, "Simplifying condjump %i around jump %i\n",
|
||||
|
@ -1054,6 +1049,9 @@ try_optimize_cfg (mode)
|
|||
bool changed;
|
||||
int iterations = 0;
|
||||
|
||||
if (mode & CLEANUP_CROSSJUMP)
|
||||
add_noreturn_fake_exit_edges ();
|
||||
|
||||
/* Attempt to merge blocks as made possible by edge removal. If a block
|
||||
has only one successor, and the successor has only one predecessor,
|
||||
they may be combined. */
|
||||
|
@ -1184,6 +1182,10 @@ try_optimize_cfg (mode)
|
|||
changed_overall |= changed;
|
||||
}
|
||||
while (changed);
|
||||
|
||||
if (mode & CLEANUP_CROSSJUMP)
|
||||
remove_fake_edges ();
|
||||
|
||||
return changed_overall;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3528,7 +3528,7 @@ emit_insns_after (first, after)
|
|||
abort ();
|
||||
|
||||
if (!first)
|
||||
return first;
|
||||
return after;
|
||||
|
||||
if (basic_block_for_insn
|
||||
&& (unsigned int)INSN_UID (after) < basic_block_for_insn->num_elements
|
||||
|
|
18
gcc/final.c
18
gcc/final.c
|
@ -1972,8 +1972,7 @@ final (first, file, optimize, prescan)
|
|||
&& NOTE_LINE_NUMBER (insn) == NOTE_LINE_NUMBER (last)
|
||||
&& NOTE_SOURCE_FILE (insn) == NOTE_SOURCE_FILE (last)))
|
||||
{
|
||||
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (insn) = 0;
|
||||
delete_note (insn);
|
||||
continue;
|
||||
}
|
||||
last = insn;
|
||||
|
@ -2719,9 +2718,7 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
|
|||
(It would not be recognized.) */
|
||||
if (SET_SRC (body) == pc_rtx)
|
||||
{
|
||||
PUT_CODE (insn, NOTE);
|
||||
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (insn) = 0;
|
||||
delete_insn (insn);
|
||||
break;
|
||||
}
|
||||
else if (GET_CODE (SET_SRC (body)) == RETURN)
|
||||
|
@ -2780,11 +2777,7 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
|
|||
else if (result == 2)
|
||||
INSN_CODE (insn) = -1;
|
||||
if (SET_DEST (set) == SET_SRC (set))
|
||||
{
|
||||
PUT_CODE (insn, NOTE);
|
||||
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (insn) = 0;
|
||||
}
|
||||
delete_insn (insn);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -2902,10 +2895,7 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
|
|||
prev = PREV_INSN (prev))
|
||||
{
|
||||
if (GET_CODE (prev) == NOTE)
|
||||
{
|
||||
NOTE_LINE_NUMBER (prev) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (prev) = 0;
|
||||
}
|
||||
delete_insn (prev); /* Use delete_note. */
|
||||
}
|
||||
|
||||
return prev;
|
||||
|
|
|
@ -1719,11 +1719,7 @@ fixup_var_refs_insn (insn, var, promoted_mode, unsignedp, toplevel)
|
|||
find_reg_note (XEXP (note, 0), REG_RETVAL,
|
||||
NULL_RTX));
|
||||
|
||||
/* In unoptimized compilation, we shouldn't call delete_insn
|
||||
except in jump.c doing warnings. */
|
||||
PUT_CODE (insn, NOTE);
|
||||
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (insn) = 0;
|
||||
delete_insn (insn);
|
||||
}
|
||||
|
||||
/* The insn to load VAR from a home in the arglist
|
||||
|
@ -1744,11 +1740,7 @@ fixup_var_refs_insn (insn, var, promoted_mode, unsignedp, toplevel)
|
|||
&& SET_DEST (prev_set) == SET_SRC (set)
|
||||
&& rtx_equal_p (SET_SRC (prev_set), var))))
|
||||
{
|
||||
/* In unoptimized compilation, we shouldn't call delete_insn
|
||||
except in jump.c doing warnings. */
|
||||
PUT_CODE (insn, NOTE);
|
||||
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (insn) = 0;
|
||||
delete_insn (insn);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2360,9 +2352,7 @@ fixup_var_refs_1 (var, promoted_mode, loc, insn, replacements)
|
|||
REG_NOTES (insn) = REG_NOTES (last);
|
||||
PATTERN (insn) = PATTERN (last);
|
||||
|
||||
PUT_CODE (last, NOTE);
|
||||
NOTE_LINE_NUMBER (last) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (last) = 0;
|
||||
delete_insn (last);
|
||||
}
|
||||
else
|
||||
PATTERN (insn) = pat;
|
||||
|
@ -2405,9 +2395,7 @@ fixup_var_refs_1 (var, promoted_mode, loc, insn, replacements)
|
|||
REG_NOTES (insn) = REG_NOTES (last);
|
||||
PATTERN (insn) = PATTERN (last);
|
||||
|
||||
PUT_CODE (last, NOTE);
|
||||
NOTE_LINE_NUMBER (last) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (last) = 0;
|
||||
delete_insn (last);
|
||||
}
|
||||
else
|
||||
PATTERN (insn) = pat;
|
||||
|
@ -7154,9 +7142,7 @@ keep_stack_depressed (seq)
|
|||
sp_modified_unknown = 1;
|
||||
|
||||
/* Don't allow the SP modification to happen. */
|
||||
PUT_CODE (insn, NOTE);
|
||||
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (insn) = 0;
|
||||
delete_insn (insn);
|
||||
}
|
||||
else if (reg_referenced_p (stack_pointer_rtx, PATTERN (insn)))
|
||||
{
|
||||
|
|
|
@ -4102,9 +4102,7 @@ cprop_cc0_jump (bb, insn, reg_used, src)
|
|||
return 0;
|
||||
|
||||
/* If we succeeded, delete the cc0 setter. */
|
||||
PUT_CODE (insn, NOTE);
|
||||
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (insn) = 0;
|
||||
delete_insn (insn);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -1107,9 +1107,7 @@ update_equiv_regs ()
|
|||
remove_death (regno, insn);
|
||||
REG_N_REFS (regno) = 0;
|
||||
REG_FREQ (regno) = 0;
|
||||
PUT_CODE (equiv_insn, NOTE);
|
||||
NOTE_LINE_NUMBER (equiv_insn) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (equiv_insn) = 0;
|
||||
delete_insn (equiv_insn);
|
||||
|
||||
reg_equiv[regno].init_insns
|
||||
= XEXP (reg_equiv[regno].init_insns, 1);
|
||||
|
@ -1128,9 +1126,7 @@ update_equiv_regs ()
|
|||
otherwise eliminate_regs_in_insn will abort. */
|
||||
INSN_CODE (new_insn) = INSN_CODE (equiv_insn);
|
||||
|
||||
PUT_CODE (equiv_insn, NOTE);
|
||||
NOTE_LINE_NUMBER (equiv_insn) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (equiv_insn) = 0;
|
||||
delete_insn (equiv_insn);
|
||||
|
||||
XEXP (reg_equiv[regno].init_insns, 0) = new_insn;
|
||||
|
||||
|
|
|
@ -807,9 +807,7 @@ scan_loop (loop, flags)
|
|||
= replace_rtx (REG_NOTES (regs->array[regno].single_usage),
|
||||
SET_DEST (set), copy_rtx (SET_SRC (set)));
|
||||
|
||||
PUT_CODE (p, NOTE);
|
||||
NOTE_LINE_NUMBER (p) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (p) = 0;
|
||||
delete_insn (p);
|
||||
regs->array[regno].set_in_loop = 0;
|
||||
continue;
|
||||
}
|
||||
|
@ -9340,11 +9338,10 @@ loop_delete_insns (first, last)
|
|||
{
|
||||
while (1)
|
||||
{
|
||||
PUT_CODE (first, NOTE);
|
||||
NOTE_LINE_NUMBER (first) = NOTE_INSN_DELETED;
|
||||
if (loop_dump_stream)
|
||||
fprintf (loop_dump_stream, ", deleting init_insn (%d)",
|
||||
INSN_UID (first));
|
||||
delete_insn (first);
|
||||
|
||||
/* If this was the LAST instructions we're supposed to delete,
|
||||
we're done. */
|
||||
|
|
|
@ -832,9 +832,6 @@ static void
|
|||
estimate_bb_frequencies (loops)
|
||||
struct loops *loops;
|
||||
{
|
||||
block_info bi;
|
||||
edge_info ei;
|
||||
int edgenum = 0;
|
||||
int i;
|
||||
double freq_max = 0;
|
||||
|
||||
|
@ -891,8 +888,8 @@ estimate_bb_frequencies (loops)
|
|||
ENTRY_BLOCK_PTR->succ->probability = REG_BR_PROB_BASE;
|
||||
|
||||
/* Set up block info for each basic block. */
|
||||
bi = (block_info) xcalloc ((n_basic_blocks + 2), sizeof (*bi));
|
||||
ei = (edge_info) xcalloc ((n_edges), sizeof (*ei));
|
||||
alloc_aux_for_blocks (sizeof (struct block_info_def));
|
||||
alloc_aux_for_edges (sizeof (struct edge_info_def));
|
||||
for (i = -2; i < n_basic_blocks; i++)
|
||||
{
|
||||
edge e;
|
||||
|
@ -904,14 +901,10 @@ estimate_bb_frequencies (loops)
|
|||
bb = EXIT_BLOCK_PTR;
|
||||
else
|
||||
bb = BASIC_BLOCK (i);
|
||||
bb->aux = bi + i + 2;
|
||||
BLOCK_INFO (bb)->tovisit = 0;
|
||||
for (e = bb->succ; e; e = e->succ_next)
|
||||
{
|
||||
e->aux = ei + edgenum, edgenum++;
|
||||
EDGE_INFO (e)->back_edge_prob = ((double) e->probability
|
||||
/ REG_BR_PROB_BASE);
|
||||
}
|
||||
EDGE_INFO (e)->back_edge_prob = ((double) e->probability
|
||||
/ REG_BR_PROB_BASE);
|
||||
}
|
||||
/* First compute probabilities locally for each loop from innermost
|
||||
to outermost to examine probabilities for back edges. */
|
||||
|
@ -940,6 +933,6 @@ estimate_bb_frequencies (loops)
|
|||
+ 0.5);
|
||||
}
|
||||
|
||||
free (ei);
|
||||
free (bi);
|
||||
free_aux_for_blocks ();
|
||||
free_aux_for_edges ();
|
||||
}
|
||||
|
|
|
@ -217,18 +217,15 @@ compute_branch_probabilities ()
|
|||
int hist_br_prob[20];
|
||||
int num_never_executed;
|
||||
int num_branches;
|
||||
struct bb_info *bb_infos;
|
||||
|
||||
/* Attach extra info block to each bb. */
|
||||
|
||||
bb_infos = (struct bb_info *)
|
||||
xcalloc (n_basic_blocks + 2, sizeof (struct bb_info));
|
||||
alloc_aux_for_blocks (sizeof (struct bb_info));
|
||||
for (i = 0; i < n_basic_blocks + 2; i++)
|
||||
{
|
||||
basic_block bb = GCOV_INDEX_TO_BB (i);
|
||||
edge e;
|
||||
|
||||
bb->aux = &bb_infos[i];
|
||||
for (e = bb->succ; e; e = e->succ_next)
|
||||
if (!EDGE_INFO (e)->ignore)
|
||||
BB_INFO (bb)->succ_count++;
|
||||
|
@ -496,7 +493,7 @@ compute_branch_probabilities ()
|
|||
fputc ('\n', rtl_dump_file);
|
||||
}
|
||||
|
||||
free (bb_infos);
|
||||
free_aux_for_blocks ();
|
||||
}
|
||||
|
||||
/* Instrument and/or analyze program behavior based on program flow graph.
|
||||
|
@ -520,7 +517,6 @@ branch_prob ()
|
|||
{
|
||||
int i;
|
||||
int num_edges, ignored_edges;
|
||||
struct edge_info *edge_infos;
|
||||
struct edge_list *el;
|
||||
|
||||
/* Start of a function. */
|
||||
|
@ -612,15 +608,13 @@ branch_prob ()
|
|||
|
||||
el = create_edge_list ();
|
||||
num_edges = NUM_EDGES (el);
|
||||
edge_infos = (struct edge_info *)
|
||||
xcalloc (num_edges, sizeof (struct edge_info));
|
||||
alloc_aux_for_edges (sizeof (struct edge_info));
|
||||
|
||||
ignored_edges = 0;
|
||||
for (i = 0 ; i < num_edges ; i++)
|
||||
{
|
||||
edge e = INDEX_EDGE (el, i);
|
||||
e->count = 0;
|
||||
e->aux = &edge_infos[i];
|
||||
|
||||
/* Mark edges we've replaced by fake edges above as ignored. */
|
||||
if ((e->flags & (EDGE_ABNORMAL | EDGE_ABNORMAL_CALL))
|
||||
|
@ -803,7 +797,7 @@ branch_prob ()
|
|||
if (rtl_dump_file)
|
||||
dump_flow_info (rtl_dump_file);
|
||||
|
||||
free (edge_infos);
|
||||
free_aux_for_edges ();
|
||||
free_edge_list (el);
|
||||
}
|
||||
|
||||
|
@ -904,6 +898,11 @@ find_spanning_tree (el)
|
|||
union_groups (e->src, e->dest);
|
||||
}
|
||||
}
|
||||
|
||||
EXIT_BLOCK_PTR->aux = NULL;
|
||||
ENTRY_BLOCK_PTR->aux = NULL;
|
||||
for (i = 0; i < n_basic_blocks; i++)
|
||||
BASIC_BLOCK (i)->aux = NULL;
|
||||
}
|
||||
|
||||
/* Perform file-level initialization for branch-prob processing. */
|
||||
|
|
|
@ -420,7 +420,6 @@ reg_to_stack (first, file)
|
|||
{
|
||||
int i;
|
||||
int max_uid;
|
||||
block_info bi;
|
||||
|
||||
/* Clean up previous run. */
|
||||
if (stack_regs_mentioned_data)
|
||||
|
@ -449,18 +448,16 @@ reg_to_stack (first, file)
|
|||
mark_dfs_back_edges ();
|
||||
|
||||
/* Set up block info for each basic block. */
|
||||
bi = (block_info) xcalloc ((n_basic_blocks + 1), sizeof (*bi));
|
||||
alloc_aux_for_blocks (sizeof (struct block_info_def));
|
||||
for (i = n_basic_blocks - 1; i >= 0; --i)
|
||||
{
|
||||
edge e;
|
||||
basic_block bb = BASIC_BLOCK (i);
|
||||
bb->aux = bi + i;
|
||||
for (e = bb->pred; e; e=e->pred_next)
|
||||
if (!(e->flags & EDGE_DFS_BACK)
|
||||
&& e->src != ENTRY_BLOCK_PTR)
|
||||
BLOCK_INFO (bb)->predecesors++;
|
||||
}
|
||||
EXIT_BLOCK_PTR->aux = bi + n_basic_blocks;
|
||||
|
||||
/* Create the replacement registers up front. */
|
||||
for (i = FIRST_STACK_REG; i <= LAST_STACK_REG; i++)
|
||||
|
@ -500,7 +497,7 @@ reg_to_stack (first, file)
|
|||
|
||||
convert_regs (file);
|
||||
|
||||
free (bi);
|
||||
free_aux_for_blocks ();
|
||||
}
|
||||
|
||||
/* Check PAT, which is in INSN, for LABEL_REFs. Add INSN to the
|
||||
|
|
|
@ -148,11 +148,7 @@ try_auto_increment (insn, inc_insn, inc_insn_set, reg, increment, pre)
|
|||
= gen_rtx_EXPR_LIST (REG_INC,
|
||||
reg, REG_NOTES (insn));
|
||||
if (! inc_insn_set)
|
||||
{
|
||||
PUT_CODE (inc_insn, NOTE);
|
||||
NOTE_LINE_NUMBER (inc_insn) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (inc_insn) = 0;
|
||||
}
|
||||
delete_insn (inc_insn);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -1895,9 +1891,7 @@ fixup_match_1 (insn, set, src, src_subreg, dst, backward, operand_number,
|
|||
rtx notes = REG_NOTES (insn);
|
||||
|
||||
emit_insn_after_with_line_notes (pat, PREV_INSN (p), insn);
|
||||
PUT_CODE (insn, NOTE);
|
||||
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (insn) = 0;
|
||||
delete_insn (insn);
|
||||
/* emit_insn_after_with_line_notes has no
|
||||
return value, so search for the new insn. */
|
||||
insn = p;
|
||||
|
@ -1949,9 +1943,7 @@ fixup_match_1 (insn, set, src, src_subreg, dst, backward, operand_number,
|
|||
if (q && set2 && SET_DEST (set2) == src && CONSTANT_P (SET_SRC (set2))
|
||||
&& validate_change (insn, &SET_SRC (set), XEXP (note, 0), 0))
|
||||
{
|
||||
PUT_CODE (q, NOTE);
|
||||
NOTE_LINE_NUMBER (q) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (q) = 0;
|
||||
delete_insn (q);
|
||||
REG_N_SETS (REGNO (src))--;
|
||||
REG_N_CALLS_CROSSED (REGNO (src)) -= num_calls2;
|
||||
REG_LIVE_LENGTH (REGNO (src)) -= s_length2;
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -555,9 +555,7 @@ replace_call_placeholder (insn, use)
|
|||
LABEL_PRESERVE_P (XEXP (PATTERN (insn), 3)) = 0;
|
||||
|
||||
/* "Delete" the placeholder insn. */
|
||||
PUT_CODE (insn, NOTE);
|
||||
NOTE_SOURCE_FILE (insn) = 0;
|
||||
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
|
||||
remove_insn (insn);
|
||||
}
|
||||
|
||||
/* Given a (possibly empty) set of potential sibling or tail recursion call
|
||||
|
|
|
@ -2154,14 +2154,7 @@ copy_loop_body (loop, copy_start, copy_end, map, exit_label, last_iteration,
|
|||
/* If this is now a no-op, delete it. */
|
||||
if (map->last_pc_value == pc_rtx)
|
||||
{
|
||||
/* Don't let delete_insn delete the label referenced here,
|
||||
because we might possibly need it later for some other
|
||||
instruction in the loop. */
|
||||
if (JUMP_LABEL (copy))
|
||||
LABEL_NUSES (JUMP_LABEL (copy))++;
|
||||
delete_related_insns (copy);
|
||||
if (JUMP_LABEL (copy))
|
||||
LABEL_NUSES (JUMP_LABEL (copy))--;
|
||||
delete_insn (copy);
|
||||
copy = 0;
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue