summaryrefslogtreecommitdiff
path: root/gcc/cfgrtl.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-02 21:09:54 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-02 21:09:54 +0000
commitab87d1bca7874b6b6cf39626dd934548d6329ad0 (patch)
treecefa93bd4b55c17cc93db52e0412035b33082f45 /gcc/cfgrtl.c
parentb2e455f87d2e6cc23dfed04f13519f1b9810bfd6 (diff)
downloadgcc-ab87d1bca7874b6b6cf39626dd934548d6329ad0.tar.gz
* loop.c (emit_prefetch_instructions): Properly place the address computation.
* basic-block.h (basic_block_for_insn, BLOCK_FOR_INSN): Kill. (set_block_for_insn): Turn into macro. * cfgbuild.c (find_basic_block): Do not clear basic_block_for_insn. * cfglayout.c (insn_scopes): Kill. (scope_to_insns_initialize): Do not use insn_scopes. (scope_to_insns_finalize): Likewise. (duplicate_insn_chain): Likewise. (cfg_layout_initialize, cfg_layout_finalize): Do not turn scopes to notes. * cfgrtl.c (basic_block_for_insn): Kill. (delete_insn_and_edges, delete_insn_chain_and_edges): Simplify. (create_basic_block_structure): Use reorder_insns. (compute_bb_for_insn): Do not use basic_block_for_insn. (merge_blocks_nomove): Likewise. (update_bb_for_insn): Likewise. (verify_flow_info): Likewise. (set_block_for_insn): Kill. * combine.c (try_combine): Update gen_rtx_INSN call. * emit-rtl.c (gen_label_rtx): Update gen_rtx_CODE_LABEL call. (mark_insn_raw, make_jump_insn_raw, make_call_insn_raw): Clear scopes and BBs. (add_insn_after, add_insn_before, remove_insn, reorder_insns): Simplify. (emit_note_before, emit_note_after, emit_line_note_after, emit_note): Clear BB. (emit_insns_after): Simplify. (emit_copy_of_insn_after): Copy scope. * final.c (final_start_function): Lower scopes. * flow.c (check_function_return_warnings): Do not rely on deleted insn. * integrate.c (copy_insn_list): Cope scopes. * jump.c (duplicate_loop_exit_test): LIkewise; simplify. * loop.c (loop_optimize): Do not care block notes. * print-rtl.c (print_rtx): Print BB. * recog.c (apply_change_group): Simplify. * rtl.c (copy_rtx): Handle 'B'. * rtl.def (INSN, CALL_INSN, JUMP_INSN, NOTE): Add extra fields. * rtl.h (Field accessors): Update indexes. * sched-ebb.c (schedule_ebbs): Do not lower notes. * sched-rgn.c (schedule_insns): Likewise. * toplev.c (rest_of_compilation): Lower notes. * unroll.c (unroll_loop): Do not care scoping notes. (copy_loop_body): Copy scopes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54188 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgrtl.c')
-rw-r--r--gcc/cfgrtl.c71
1 files changed, 14 insertions, 57 deletions
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index f721b12f916..e40ecf23dea 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -64,9 +64,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define gen_return() NULL_RTX
#endif
-/* The basic block structure for every insn, indexed by uid. */
-varray_type basic_block_for_insn;
-
/* The labels mentioned in non-jump rtl. Valid during find_basic_blocks. */
/* ??? Should probably be using LABEL_NUSES instead. It would take a
bit of surgery to be able to use or co-opt the routines in jump. */
@@ -187,9 +184,7 @@ delete_insn_and_edges (insn)
rtx x;
bool purge = false;
- if (basic_block_for_insn
- && INSN_P (insn)
- && (unsigned int)INSN_UID (insn) < basic_block_for_insn->num_elements
+ if (INSN_P (insn)
&& BLOCK_FOR_INSN (insn)
&& BLOCK_FOR_INSN (insn)->end == insn)
purge = true;
@@ -232,9 +227,7 @@ delete_insn_chain_and_edges (first, last)
{
bool purge = false;
- if (basic_block_for_insn
- && INSN_P (last)
- && (unsigned int)INSN_UID (last) < basic_block_for_insn->num_elements
+ if (INSN_P (last)
&& BLOCK_FOR_INSN (last)
&& BLOCK_FOR_INSN (last)->end == last)
purge = true;
@@ -277,7 +270,7 @@ create_basic_block_structure (index, head, end, bb_note, after)
}
if (after != bb_note && NEXT_INSN (after) != bb_note)
- reorder_insns (bb_note, bb_note, after);
+ reorder_insns_nobb (bb_note, bb_note, after);
}
else
{
@@ -315,8 +308,7 @@ create_basic_block_structure (index, head, end, bb_note, after)
bb->flags = BB_NEW;
link_block (bb, after);
BASIC_BLOCK (index) = bb;
- if (basic_block_for_insn)
- update_bb_for_insn (bb);
+ update_bb_for_insn (bb);
/* Tag the block so that we know it has been used when considering
other basic block notes. */
@@ -440,11 +432,6 @@ compute_bb_for_insn (max)
{
basic_block bb;
- if (basic_block_for_insn)
- VARRAY_FREE (basic_block_for_insn);
-
- VARRAY_BB_INIT (basic_block_for_insn, max, "basic_block_for_insn");
-
FOR_EACH_BB (bb)
{
rtx end = bb->end;
@@ -452,9 +439,7 @@ compute_bb_for_insn (max)
for (insn = bb->head; ; insn = NEXT_INSN (insn))
{
- if (INSN_UID (insn) < max)
- VARRAY_BB (basic_block_for_insn, INSN_UID (insn)) = bb;
-
+ BLOCK_FOR_INSN (insn) = bb;
if (insn == end)
break;
}
@@ -466,10 +451,10 @@ compute_bb_for_insn (max)
void
free_bb_for_insn ()
{
- if (basic_block_for_insn)
- VARRAY_FREE (basic_block_for_insn);
-
- basic_block_for_insn = 0;
+ rtx insn;
+ for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
+ if (GET_CODE (insn) != BARRIER)
+ BLOCK_FOR_INSN (insn) = NULL;
}
/* Update insns block within BB. */
@@ -480,9 +465,6 @@ update_bb_for_insn (bb)
{
rtx insn;
- if (! basic_block_for_insn)
- return;
-
for (insn = bb->head; ; insn = NEXT_INSN (insn))
{
set_block_for_insn (insn, bb);
@@ -490,26 +472,6 @@ update_bb_for_insn (bb)
break;
}
}
-
-/* Record INSN's block as BB. */
-
-void
-set_block_for_insn (insn, bb)
- rtx insn;
- basic_block bb;
-{
- size_t uid = INSN_UID (insn);
-
- if (uid >= basic_block_for_insn->num_elements)
- {
- /* Add one-eighth the size so we don't keep calling xrealloc. */
- size_t new_size = uid + (uid + 7) / 8;
-
- VARRAY_GROW (basic_block_for_insn, new_size);
- }
-
- VARRAY_BB (basic_block_for_insn, uid) = bb;
-}
/* Split a block BB after insn INSN creating a new fallthru edge.
Return the new edge. Note that to keep other parts of the compiler happy,
@@ -668,15 +630,12 @@ merge_blocks_nomove (a, b)
/* Reassociate the insns of B with A. */
if (!b_empty)
{
- if (basic_block_for_insn)
- {
- rtx x;
+ rtx x;
- for (x = a_end; x != b_end; x = NEXT_INSN (x))
- set_block_for_insn (x, a);
+ for (x = a_end; x != b_end; x = NEXT_INSN (x))
+ set_block_for_insn (x, a);
- set_block_for_insn (b_end, a);
- }
+ set_block_for_insn (b_end, a);
a_end = b_end;
}
@@ -697,8 +656,6 @@ block_label (block)
if (GET_CODE (block->head) != CODE_LABEL)
{
block->head = emit_label_before (gen_label_rtx (), block->head);
- if (basic_block_for_insn)
- set_block_for_insn (block->head, block);
}
return block->head;
@@ -1972,7 +1929,7 @@ verify_flow_info ()
}
for (x = bb->head; x != NEXT_INSN (bb->end); x = NEXT_INSN (x))
- if (basic_block_for_insn && BLOCK_FOR_INSN (x) != bb)
+ if (BLOCK_FOR_INSN (x) != bb)
{
debug_rtx (x);
if (! BLOCK_FOR_INSN (x))