Commit 370369e1 by Jan Hubicka Committed by Jan Hubicka

basic-block.h (basic_block_def): Kill rbi.


	* basic-block.h (basic_block_def): Kill rbi.
	(reorder_block_def): Kill; Remove next field (replaced by aux);
	move other fields to ...
	(rtl_bb_info): ... here.
	* bb-reorder.c (find_traces, rotate_loop, find_traces_1_round,
	copy_bb, connect_traces, add_labels_and_missing_jumps
	fix_up_fall_thru_edges, fix_crossing_conditional_branches,
	duplicate_computed_gotos, partition_hot_cold_basic-blocks):
	Update to new fields.
	* cfg.c (initialize_bb_rbi): Kill.
	* cfglayout.c (record_effective_endpoints, fixup_reorder_chain,
	fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update.
	* cfgrtl.c (cfg_layout_create_basic_block): Do not initialize rbi.
	(try_redirect_by_replacing_jump): Update rbi references.
	(cfg_layout_split_block): Likewise.
	(cfg_layout_delete_block): Likewise.
	(cfg_layout_merge_blocks): Likewise.
	* function.c (thread_prologue_and_epilogue_insns): Likewise.
	* passes.c (rest_of_handle_sms): Likewise.
	* tracer.c (seen, tail_duplicate, layout_superblocks): Likewise.

From-SVN: r101359
parent 4ebe7d93
2005-06-28 Jan Hubicka <jh@suse.cz>
* basic-block.h (basic_block_def): Kill rbi.
(reorder_block_def): Kill; Remove next field (replaced by aux);
move other fields to ...
(rtl_bb_info): ... here.
* bb-reorder.c (find_traces, rotate_loop, find_traces_1_round,
copy_bb, connect_traces, add_labels_and_missing_jumps
fix_up_fall_thru_edges, fix_crossing_conditional_branches,
duplicate_computed_gotos, partition_hot_cold_basic-blocks):
Update to new fields.
* cfg.c (initialize_bb_rbi): Kill.
* cfglayout.c (record_effective_endpoints, fixup_reorder_chain,
fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update.
* cfgrtl.c (cfg_layout_create_basic_block): Do not initialize rbi.
(try_redirect_by_replacing_jump): Update rbi references.
(cfg_layout_split_block): Likewise.
(cfg_layout_delete_block): Likewise.
(cfg_layout_merge_blocks): Likewise.
* function.c (thread_prologue_and_epilogue_insns): Likewise.
* passes.c (rest_of_handle_sms): Likewise.
* tracer.c (seen, tail_duplicate, layout_superblocks): Likewise.
2005-06-27 David Edelsohn <edelsohn@gnu.org> 2005-06-27 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/rs6000.c (rs6000_file_start): Note PPC405 erratum * config/rs6000/rs6000.c (rs6000_file_start): Note PPC405 erratum
......
...@@ -233,9 +233,6 @@ struct basic_block_def GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb") ...@@ -233,9 +233,6 @@ struct basic_block_def GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb")
struct basic_block_def *prev_bb; struct basic_block_def *prev_bb;
struct basic_block_def *next_bb; struct basic_block_def *next_bb;
/* The data used by basic block copying and reordering functions. */
struct reorder_block_def * rbi;
union basic_block_il_dependent { union basic_block_il_dependent {
struct rtl_bb_info * GTY ((tag ("1"))) rtl; struct rtl_bb_info * GTY ((tag ("1"))) rtl;
} GTY ((desc ("((%1.flags & BB_RTL) != 0)"))) il; } GTY ((desc ("((%1.flags & BB_RTL) != 0)"))) il;
...@@ -273,25 +270,17 @@ struct rtl_bb_info GTY(()) ...@@ -273,25 +270,17 @@ struct rtl_bb_info GTY(())
/* The registers that are live on exit from this block. */ /* The registers that are live on exit from this block. */
bitmap GTY ((skip (""))) global_live_at_end; bitmap GTY ((skip (""))) global_live_at_end;
};
typedef struct basic_block_def *basic_block;
/* Structure to hold information about the blocks during reordering and
copying. Needs to be put on a diet. */
struct reorder_block_def GTY(()) /* In CFGlayout mode points to insn notes/jumptables to be placed just before
{ and after the block. */
rtx header; rtx header;
rtx footer; rtx footer;
basic_block next;
/* This field is used by the bb-reorder and tracer passes. */ /* This field is used by the bb-reorder and tracer passes. */
int visited; int visited;
}; };
typedef struct reorder_block_def *reorder_block_def; typedef struct basic_block_def *basic_block;
#define BB_FREQ_MAX 10000 #define BB_FREQ_MAX 10000
...@@ -940,9 +929,6 @@ extern void reorder_basic_blocks (unsigned int); ...@@ -940,9 +929,6 @@ extern void reorder_basic_blocks (unsigned int);
extern void duplicate_computed_gotos (void); extern void duplicate_computed_gotos (void);
extern void partition_hot_cold_basic_blocks (void); extern void partition_hot_cold_basic_blocks (void);
/* In cfg.c */
extern void initialize_bb_rbi (basic_block bb);
/* In dominance.c */ /* In dominance.c */
enum cdi_direction enum cdi_direction
......
...@@ -136,16 +136,6 @@ alloc_block (void) ...@@ -136,16 +136,6 @@ alloc_block (void)
return bb; return bb;
} }
/* Initialize rbi (the structure containing data used by basic block
duplication and reordering) for the given basic block. */
void
initialize_bb_rbi (basic_block bb)
{
gcc_assert (!bb->rbi);
bb->rbi = ggc_alloc_cleared (sizeof (struct reorder_block_def));
}
/* Link block B to chain after AFTER. */ /* Link block B to chain after AFTER. */
void void
link_block (basic_block b, basic_block after) link_block (basic_block b, basic_block after)
......
...@@ -209,11 +209,11 @@ record_effective_endpoints (void) ...@@ -209,11 +209,11 @@ record_effective_endpoints (void)
rtx end; rtx end;
if (PREV_INSN (BB_HEAD (bb)) && next_insn != BB_HEAD (bb)) if (PREV_INSN (BB_HEAD (bb)) && next_insn != BB_HEAD (bb))
bb->rbi->header = unlink_insn_chain (next_insn, bb->il.rtl->header = unlink_insn_chain (next_insn,
PREV_INSN (BB_HEAD (bb))); PREV_INSN (BB_HEAD (bb)));
end = skip_insns_after_block (bb); end = skip_insns_after_block (bb);
if (NEXT_INSN (BB_END (bb)) && BB_END (bb) != end) if (NEXT_INSN (BB_END (bb)) && BB_END (bb) != end)
bb->rbi->footer = unlink_insn_chain (NEXT_INSN (BB_END (bb)), end); bb->il.rtl->footer = unlink_insn_chain (NEXT_INSN (BB_END (bb)), end);
next_insn = NEXT_INSN (BB_END (bb)); next_insn = NEXT_INSN (BB_END (bb));
} }
...@@ -584,16 +584,16 @@ fixup_reorder_chain (void) ...@@ -584,16 +584,16 @@ fixup_reorder_chain (void)
for (bb = ENTRY_BLOCK_PTR->next_bb, index = 0; for (bb = ENTRY_BLOCK_PTR->next_bb, index = 0;
bb != 0; bb != 0;
bb = bb->rbi->next, index++) bb = bb->aux, index++)
{ {
if (bb->rbi->header) if (bb->il.rtl->header)
{ {
if (insn) if (insn)
NEXT_INSN (insn) = bb->rbi->header; NEXT_INSN (insn) = bb->il.rtl->header;
else else
set_first_insn (bb->rbi->header); set_first_insn (bb->il.rtl->header);
PREV_INSN (bb->rbi->header) = insn; PREV_INSN (bb->il.rtl->header) = insn;
insn = bb->rbi->header; insn = bb->il.rtl->header;
while (NEXT_INSN (insn)) while (NEXT_INSN (insn))
insn = NEXT_INSN (insn); insn = NEXT_INSN (insn);
} }
...@@ -603,10 +603,10 @@ fixup_reorder_chain (void) ...@@ -603,10 +603,10 @@ fixup_reorder_chain (void)
set_first_insn (BB_HEAD (bb)); set_first_insn (BB_HEAD (bb));
PREV_INSN (BB_HEAD (bb)) = insn; PREV_INSN (BB_HEAD (bb)) = insn;
insn = BB_END (bb); insn = BB_END (bb);
if (bb->rbi->footer) if (bb->il.rtl->footer)
{ {
NEXT_INSN (insn) = bb->rbi->footer; NEXT_INSN (insn) = bb->il.rtl->footer;
PREV_INSN (bb->rbi->footer) = insn; PREV_INSN (bb->il.rtl->footer) = insn;
while (NEXT_INSN (insn)) while (NEXT_INSN (insn))
insn = NEXT_INSN (insn); insn = NEXT_INSN (insn);
} }
...@@ -630,7 +630,7 @@ fixup_reorder_chain (void) ...@@ -630,7 +630,7 @@ fixup_reorder_chain (void)
/* Now add jumps and labels as needed to match the blocks new /* Now add jumps and labels as needed to match the blocks new
outgoing edges. */ outgoing edges. */
for (bb = ENTRY_BLOCK_PTR->next_bb; bb ; bb = bb->rbi->next) for (bb = ENTRY_BLOCK_PTR->next_bb; bb ; bb = bb->aux)
{ {
edge e_fall, e_taken, e; edge e_fall, e_taken, e;
rtx bb_end_insn; rtx bb_end_insn;
...@@ -656,7 +656,7 @@ fixup_reorder_chain (void) ...@@ -656,7 +656,7 @@ fixup_reorder_chain (void)
if (any_condjump_p (bb_end_insn)) if (any_condjump_p (bb_end_insn))
{ {
/* If the old fallthru is still next, nothing to do. */ /* If the old fallthru is still next, nothing to do. */
if (bb->rbi->next == e_fall->dest if (bb->aux == e_fall->dest
|| e_fall->dest == EXIT_BLOCK_PTR) || e_fall->dest == EXIT_BLOCK_PTR)
continue; continue;
...@@ -699,7 +699,7 @@ fixup_reorder_chain (void) ...@@ -699,7 +699,7 @@ fixup_reorder_chain (void)
such as happens at the very end of a function, then we'll such as happens at the very end of a function, then we'll
need to add a new unconditional jump. Choose the taken need to add a new unconditional jump. Choose the taken
edge based on known or assumed probability. */ edge based on known or assumed probability. */
else if (bb->rbi->next != e_taken->dest) else if (bb->aux != e_taken->dest)
{ {
rtx note = find_reg_note (bb_end_insn, REG_BR_PROB, 0); rtx note = find_reg_note (bb_end_insn, REG_BR_PROB, 0);
...@@ -762,7 +762,7 @@ fixup_reorder_chain (void) ...@@ -762,7 +762,7 @@ fixup_reorder_chain (void)
continue; continue;
/* If the fallthru block is still next, nothing to do. */ /* If the fallthru block is still next, nothing to do. */
if (bb->rbi->next == e_fall->dest) if (bb->aux == e_fall->dest)
continue; continue;
/* A fallthru to exit block. */ /* A fallthru to exit block. */
...@@ -774,10 +774,9 @@ fixup_reorder_chain (void) ...@@ -774,10 +774,9 @@ fixup_reorder_chain (void)
nb = force_nonfallthru (e_fall); nb = force_nonfallthru (e_fall);
if (nb) if (nb)
{ {
initialize_bb_rbi (nb); nb->il.rtl->visited = 1;
nb->rbi->visited = 1; nb->aux = bb->aux;
nb->rbi->next = bb->rbi->next; bb->aux = nb;
bb->rbi->next = nb;
/* Don't process this new block. */ /* Don't process this new block. */
bb = nb; bb = nb;
...@@ -802,7 +801,7 @@ fixup_reorder_chain (void) ...@@ -802,7 +801,7 @@ fixup_reorder_chain (void)
fprintf (dump_file, "Reordered sequence:\n"); fprintf (dump_file, "Reordered sequence:\n");
for (bb = ENTRY_BLOCK_PTR->next_bb, index = 0; for (bb = ENTRY_BLOCK_PTR->next_bb, index = 0;
bb; bb;
bb = bb->rbi->next, index++) bb = bb->aux, index++)
{ {
fprintf (dump_file, " %i ", index); fprintf (dump_file, " %i ", index);
if (get_bb_original (bb)) if (get_bb_original (bb))
...@@ -821,7 +820,7 @@ fixup_reorder_chain (void) ...@@ -821,7 +820,7 @@ fixup_reorder_chain (void)
bb = ENTRY_BLOCK_PTR->next_bb; bb = ENTRY_BLOCK_PTR->next_bb;
index = 0; index = 0;
for (; bb; prev_bb = bb, bb = bb->rbi->next, index ++) for (; bb; prev_bb = bb, bb = bb->aux, index ++)
{ {
bb->index = index; bb->index = index;
BASIC_BLOCK (index) = bb; BASIC_BLOCK (index) = bb;
...@@ -893,7 +892,7 @@ fixup_fallthru_exit_predecessor (void) ...@@ -893,7 +892,7 @@ fixup_fallthru_exit_predecessor (void)
if (e->flags & EDGE_FALLTHRU) if (e->flags & EDGE_FALLTHRU)
bb = e->src; bb = e->src;
if (bb && bb->rbi->next) if (bb && bb->aux)
{ {
basic_block c = ENTRY_BLOCK_PTR->next_bb; basic_block c = ENTRY_BLOCK_PTR->next_bb;
...@@ -902,22 +901,21 @@ fixup_fallthru_exit_predecessor (void) ...@@ -902,22 +901,21 @@ fixup_fallthru_exit_predecessor (void)
if (c == bb) if (c == bb)
{ {
bb = split_block (bb, NULL)->dest; bb = split_block (bb, NULL)->dest;
initialize_bb_rbi (bb); bb->aux = c->aux;
bb->rbi->next = c->rbi->next; c->aux = bb;
c->rbi->next = bb; bb->il.rtl->footer = c->il.rtl->footer;
bb->rbi->footer = c->rbi->footer; c->il.rtl->footer = NULL;
c->rbi->footer = NULL;
} }
while (c->rbi->next != bb) while (c->aux != bb)
c = c->rbi->next; c = c->aux;
c->rbi->next = bb->rbi->next; c->aux = bb->aux;
while (c->rbi->next) while (c->aux)
c = c->rbi->next; c = c->aux;
c->rbi->next = bb; c->aux = bb;
bb->rbi->next = NULL; bb->aux = NULL;
} }
} }
...@@ -1057,24 +1055,24 @@ cfg_layout_duplicate_bb (basic_block bb) ...@@ -1057,24 +1055,24 @@ cfg_layout_duplicate_bb (basic_block bb)
EXIT_BLOCK_PTR->prev_bb); EXIT_BLOCK_PTR->prev_bb);
BB_COPY_PARTITION (new_bb, bb); BB_COPY_PARTITION (new_bb, bb);
if (bb->rbi->header) if (bb->il.rtl->header)
{ {
insn = bb->rbi->header; insn = bb->il.rtl->header;
while (NEXT_INSN (insn)) while (NEXT_INSN (insn))
insn = NEXT_INSN (insn); insn = NEXT_INSN (insn);
insn = duplicate_insn_chain (bb->rbi->header, insn); insn = duplicate_insn_chain (bb->il.rtl->header, insn);
if (insn) if (insn)
new_bb->rbi->header = unlink_insn_chain (insn, get_last_insn ()); new_bb->il.rtl->header = unlink_insn_chain (insn, get_last_insn ());
} }
if (bb->rbi->footer) if (bb->il.rtl->footer)
{ {
insn = bb->rbi->footer; insn = bb->il.rtl->footer;
while (NEXT_INSN (insn)) while (NEXT_INSN (insn))
insn = NEXT_INSN (insn); insn = NEXT_INSN (insn);
insn = duplicate_insn_chain (bb->rbi->footer, insn); insn = duplicate_insn_chain (bb->il.rtl->footer, insn);
if (insn) if (insn)
new_bb->rbi->footer = unlink_insn_chain (insn, get_last_insn ()); new_bb->il.rtl->footer = unlink_insn_chain (insn, get_last_insn ());
} }
if (bb->il.rtl->global_live_at_start) if (bb->il.rtl->global_live_at_start)
...@@ -1100,11 +1098,6 @@ cfg_layout_duplicate_bb (basic_block bb) ...@@ -1100,11 +1098,6 @@ cfg_layout_duplicate_bb (basic_block bb)
void void
cfg_layout_initialize (unsigned int flags) cfg_layout_initialize (unsigned int flags)
{ {
basic_block bb;
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
initialize_bb_rbi (bb);
initialize_original_copy_tables (); initialize_original_copy_tables ();
cfg_layout_rtl_register_cfg_hooks (); cfg_layout_rtl_register_cfg_hooks ();
...@@ -1142,8 +1135,8 @@ break_superblocks (void) ...@@ -1142,8 +1135,8 @@ break_superblocks (void)
free (superblocks); free (superblocks);
} }
/* Finalize the changes: reorder insn list according to the sequence, enter /* Finalize the changes: reorder insn list according to the sequence specified
compensation code, rebuild scope forest. */ by aux pointers, enter compensation code, rebuild scope forest. */
void void
cfg_layout_finalize (void) cfg_layout_finalize (void)
...@@ -1166,7 +1159,11 @@ cfg_layout_finalize (void) ...@@ -1166,7 +1159,11 @@ cfg_layout_finalize (void)
verify_insn_chain (); verify_insn_chain ();
#endif #endif
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb) FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
bb->rbi = NULL; {
bb->il.rtl->header = bb->il.rtl->footer = NULL;
bb->aux = NULL;
bb->il.rtl->visited = 0;
}
break_superblocks (); break_superblocks ();
......
...@@ -345,7 +345,6 @@ cfg_layout_create_basic_block (void *head, void *end, basic_block after) ...@@ -345,7 +345,6 @@ cfg_layout_create_basic_block (void *head, void *end, basic_block after)
{ {
basic_block newbb = rtl_create_basic_block (head, end, after); basic_block newbb = rtl_create_basic_block (head, end, after);
initialize_bb_rbi (newbb);
return newbb; return newbb;
} }
...@@ -713,7 +712,7 @@ try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout) ...@@ -713,7 +712,7 @@ try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout)
/* Selectively unlink whole insn chain. */ /* Selectively unlink whole insn chain. */
if (in_cfglayout) if (in_cfglayout)
{ {
rtx insn = src->rbi->footer; rtx insn = src->il.rtl->footer;
delete_insn_chain (kill_from, BB_END (src)); delete_insn_chain (kill_from, BB_END (src));
...@@ -725,7 +724,7 @@ try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout) ...@@ -725,7 +724,7 @@ try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout)
if (PREV_INSN (insn)) if (PREV_INSN (insn))
NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn); NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn);
else else
src->rbi->footer = NEXT_INSN (insn); src->il.rtl->footer = NEXT_INSN (insn);
if (NEXT_INSN (insn)) if (NEXT_INSN (insn))
PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn); PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn);
} }
...@@ -2490,8 +2489,8 @@ cfg_layout_split_block (basic_block bb, void *insnp) ...@@ -2490,8 +2489,8 @@ cfg_layout_split_block (basic_block bb, void *insnp)
rtx insn = insnp; rtx insn = insnp;
basic_block new_bb = rtl_split_block (bb, insn); basic_block new_bb = rtl_split_block (bb, insn);
new_bb->rbi->footer = bb->rbi->footer; new_bb->il.rtl->footer = bb->il.rtl->footer;
bb->rbi->footer = NULL; bb->il.rtl->footer = NULL;
return new_bb; return new_bb;
} }
...@@ -2597,24 +2596,24 @@ cfg_layout_delete_block (basic_block bb) ...@@ -2597,24 +2596,24 @@ cfg_layout_delete_block (basic_block bb)
{ {
rtx insn, next, prev = PREV_INSN (BB_HEAD (bb)), *to, remaints; rtx insn, next, prev = PREV_INSN (BB_HEAD (bb)), *to, remaints;
if (bb->rbi->header) if (bb->il.rtl->header)
{ {
next = BB_HEAD (bb); next = BB_HEAD (bb);
if (prev) if (prev)
NEXT_INSN (prev) = bb->rbi->header; NEXT_INSN (prev) = bb->il.rtl->header;
else else
set_first_insn (bb->rbi->header); set_first_insn (bb->il.rtl->header);
PREV_INSN (bb->rbi->header) = prev; PREV_INSN (bb->il.rtl->header) = prev;
insn = bb->rbi->header; insn = bb->il.rtl->header;
while (NEXT_INSN (insn)) while (NEXT_INSN (insn))
insn = NEXT_INSN (insn); insn = NEXT_INSN (insn);
NEXT_INSN (insn) = next; NEXT_INSN (insn) = next;
PREV_INSN (next) = insn; PREV_INSN (next) = insn;
} }
next = NEXT_INSN (BB_END (bb)); next = NEXT_INSN (BB_END (bb));
if (bb->rbi->footer) if (bb->il.rtl->footer)
{ {
insn = bb->rbi->footer; insn = bb->il.rtl->footer;
while (insn) while (insn)
{ {
if (BARRIER_P (insn)) if (BARRIER_P (insn))
...@@ -2622,7 +2621,7 @@ cfg_layout_delete_block (basic_block bb) ...@@ -2622,7 +2621,7 @@ cfg_layout_delete_block (basic_block bb)
if (PREV_INSN (insn)) if (PREV_INSN (insn))
NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn); NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn);
else else
bb->rbi->footer = NEXT_INSN (insn); bb->il.rtl->footer = NEXT_INSN (insn);
if (NEXT_INSN (insn)) if (NEXT_INSN (insn))
PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn); PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn);
} }
...@@ -2630,11 +2629,11 @@ cfg_layout_delete_block (basic_block bb) ...@@ -2630,11 +2629,11 @@ cfg_layout_delete_block (basic_block bb)
break; break;
insn = NEXT_INSN (insn); insn = NEXT_INSN (insn);
} }
if (bb->rbi->footer) if (bb->il.rtl->footer)
{ {
insn = BB_END (bb); insn = BB_END (bb);
NEXT_INSN (insn) = bb->rbi->footer; NEXT_INSN (insn) = bb->il.rtl->footer;
PREV_INSN (bb->rbi->footer) = insn; PREV_INSN (bb->il.rtl->footer) = insn;
while (NEXT_INSN (insn)) while (NEXT_INSN (insn))
insn = NEXT_INSN (insn); insn = NEXT_INSN (insn);
NEXT_INSN (insn) = next; NEXT_INSN (insn) = next;
...@@ -2645,12 +2644,10 @@ cfg_layout_delete_block (basic_block bb) ...@@ -2645,12 +2644,10 @@ cfg_layout_delete_block (basic_block bb)
} }
} }
if (bb->next_bb != EXIT_BLOCK_PTR) if (bb->next_bb != EXIT_BLOCK_PTR)
to = &bb->next_bb->rbi->header; to = &bb->next_bb->il.rtl->header;
else else
to = &cfg_layout_function_footer; to = &cfg_layout_function_footer;
bb->rbi = NULL;
rtl_delete_block (bb); rtl_delete_block (bb);
if (prev) if (prev)
...@@ -2727,13 +2724,13 @@ cfg_layout_merge_blocks (basic_block a, basic_block b) ...@@ -2727,13 +2724,13 @@ cfg_layout_merge_blocks (basic_block a, basic_block b)
gcc_assert (!JUMP_P (BB_END (a))); gcc_assert (!JUMP_P (BB_END (a)));
/* Possible line number notes should appear in between. */ /* Possible line number notes should appear in between. */
if (b->rbi->header) if (b->il.rtl->header)
{ {
rtx first = BB_END (a), last; rtx first = BB_END (a), last;
last = emit_insn_after_noloc (b->rbi->header, BB_END (a)); last = emit_insn_after_noloc (b->il.rtl->header, BB_END (a));
delete_insn_chain (NEXT_INSN (first), last); delete_insn_chain (NEXT_INSN (first), last);
b->rbi->header = NULL; b->il.rtl->header = NULL;
} }
/* In the case basic blocks are not adjacent, move them around. */ /* In the case basic blocks are not adjacent, move them around. */
...@@ -2769,20 +2766,20 @@ cfg_layout_merge_blocks (basic_block a, basic_block b) ...@@ -2769,20 +2766,20 @@ cfg_layout_merge_blocks (basic_block a, basic_block b)
} }
/* Possible tablejumps and barriers should appear after the block. */ /* Possible tablejumps and barriers should appear after the block. */
if (b->rbi->footer) if (b->il.rtl->footer)
{ {
if (!a->rbi->footer) if (!a->il.rtl->footer)
a->rbi->footer = b->rbi->footer; a->il.rtl->footer = b->il.rtl->footer;
else else
{ {
rtx last = a->rbi->footer; rtx last = a->il.rtl->footer;
while (NEXT_INSN (last)) while (NEXT_INSN (last))
last = NEXT_INSN (last); last = NEXT_INSN (last);
NEXT_INSN (last) = b->rbi->footer; NEXT_INSN (last) = b->il.rtl->footer;
PREV_INSN (b->rbi->footer) = last; PREV_INSN (b->il.rtl->footer) = last;
} }
b->rbi->footer = NULL; b->il.rtl->footer = NULL;
} }
a->il.rtl->global_live_at_end = b->il.rtl->global_live_at_end; a->il.rtl->global_live_at_end = b->il.rtl->global_live_at_end;
......
...@@ -5233,7 +5233,7 @@ thread_prologue_and_epilogue_insns (rtx f ATTRIBUTE_UNUSED) ...@@ -5233,7 +5233,7 @@ thread_prologue_and_epilogue_insns (rtx f ATTRIBUTE_UNUSED)
cfg_layout_initialize (0); cfg_layout_initialize (0);
FOR_EACH_BB (cur_bb) FOR_EACH_BB (cur_bb)
if (cur_bb->index >= 0 && cur_bb->next_bb->index >= 0) if (cur_bb->index >= 0 && cur_bb->next_bb->index >= 0)
cur_bb->rbi->next = cur_bb->next_bb; cur_bb->aux = cur_bb->next_bb;
cfg_layout_finalize (); cfg_layout_finalize ();
} }
epilogue_done: epilogue_done:
......
...@@ -600,7 +600,7 @@ rest_of_handle_sms (void) ...@@ -600,7 +600,7 @@ rest_of_handle_sms (void)
/* Finalize layout changes. */ /* Finalize layout changes. */
FOR_EACH_BB (bb) FOR_EACH_BB (bb)
if (bb->next_bb != EXIT_BLOCK_PTR) if (bb->next_bb != EXIT_BLOCK_PTR)
bb->rbi->next = bb->next_bb; bb->aux = bb->next_bb;
cfg_layout_finalize (); cfg_layout_finalize ();
free_dominance_info (CDI_DOMINATORS); free_dominance_info (CDI_DOMINATORS);
ggc_collect (); ggc_collect ();
...@@ -1187,7 +1187,7 @@ rest_of_handle_loop2 (void) ...@@ -1187,7 +1187,7 @@ rest_of_handle_loop2 (void)
/* Finalize layout changes. */ /* Finalize layout changes. */
FOR_EACH_BB (bb) FOR_EACH_BB (bb)
if (bb->next_bb != EXIT_BLOCK_PTR) if (bb->next_bb != EXIT_BLOCK_PTR)
bb->rbi->next = bb->next_bb; bb->aux = bb->next_bb;
cfg_layout_finalize (); cfg_layout_finalize ();
cleanup_cfg (CLEANUP_EXPENSIVE); cleanup_cfg (CLEANUP_EXPENSIVE);
......
...@@ -65,7 +65,7 @@ static int branch_ratio_cutoff; ...@@ -65,7 +65,7 @@ static int branch_ratio_cutoff;
/* Return true if BB has been seen - it is connected to some trace /* Return true if BB has been seen - it is connected to some trace
already. */ already. */
#define seen(bb) (bb->rbi->visited || bb->rbi->next) #define seen(bb) (bb->il.rtl->visited || bb->aux)
/* Return true if we should ignore the basic block for purposes of tracing. */ /* Return true if we should ignore the basic block for purposes of tracing. */
static bool static bool
...@@ -292,8 +292,8 @@ tail_duplicate (void) ...@@ -292,8 +292,8 @@ tail_duplicate (void)
fprintf (dump_file, "Duplicated %i as %i [%i]\n", fprintf (dump_file, "Duplicated %i as %i [%i]\n",
old->index, bb2->index, bb2->frequency); old->index, bb2->index, bb2->frequency);
} }
bb->rbi->next = bb2; bb->aux = bb2;
bb2->rbi->visited = 1; bb2->il.rtl->visited = 1;
bb = bb2; bb = bb2;
/* In case the trace became infrequent, stop duplicating. */ /* In case the trace became infrequent, stop duplicating. */
if (ignore_bb_p (bb)) if (ignore_bb_p (bb))
...@@ -328,28 +328,28 @@ layout_superblocks (void) ...@@ -328,28 +328,28 @@ layout_superblocks (void)
{ {
edge_iterator ei; edge_iterator ei;
edge e, best = NULL; edge e, best = NULL;
while (end->rbi->next) while (end->aux)
end = end->rbi->next; end = end->aux;
FOR_EACH_EDGE (e, ei, end->succs) FOR_EACH_EDGE (e, ei, end->succs)
if (e->dest != EXIT_BLOCK_PTR if (e->dest != EXIT_BLOCK_PTR
&& e->dest != single_succ (ENTRY_BLOCK_PTR) && e->dest != single_succ (ENTRY_BLOCK_PTR)
&& !e->dest->rbi->visited && !e->dest->il.rtl->visited
&& (!best || EDGE_FREQUENCY (e) > EDGE_FREQUENCY (best))) && (!best || EDGE_FREQUENCY (e) > EDGE_FREQUENCY (best)))
best = e; best = e;
if (best) if (best)
{ {
end->rbi->next = best->dest; end->aux = best->dest;
best->dest->rbi->visited = 1; best->dest->il.rtl->visited = 1;
} }
else else
for (; bb != EXIT_BLOCK_PTR; bb = bb->next_bb) for (; bb != EXIT_BLOCK_PTR; bb = bb->next_bb)
{ {
if (!bb->rbi->visited) if (!bb->il.rtl->visited)
{ {
end->rbi->next = bb; end->aux = bb;
bb->rbi->visited = 1; bb->il.rtl->visited = 1;
break; break;
} }
} }
......
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