Commit 5dd56a93 by Jan Hubicka Committed by Jan Hubicka

* flow.c (recompute_reg_usage): Use basic block info to get loop_depth.

From-SVN: r30843
parent e73ccf83
Thu Dec 9 11:36:24 MET 1999 Jan Hubicka <hubicka@freesoft.cz> Thu Dec 9 11:36:24 MET 1999 Jan Hubicka <hubicka@freesoft.cz>
* flow.c (recompute_reg_usage): Use basic block info to get loop_depth.
* combine.c (try_combine, distribute_notes): Remove REG_N_REFS * combine.c (try_combine, distribute_notes): Remove REG_N_REFS
updating code. updating code.
......
...@@ -5578,6 +5578,7 @@ recompute_reg_usage (f, loop_step) ...@@ -5578,6 +5578,7 @@ recompute_reg_usage (f, loop_step)
{ {
rtx insn; rtx insn;
int i, max_reg; int i, max_reg;
int index;
/* Clear out the old data. */ /* Clear out the old data. */
max_reg = max_reg_num (); max_reg = max_reg_num ();
...@@ -5590,23 +5591,13 @@ recompute_reg_usage (f, loop_step) ...@@ -5590,23 +5591,13 @@ recompute_reg_usage (f, loop_step)
/* Scan each insn in the chain and count how many times each register is /* Scan each insn in the chain and count how many times each register is
set/used. */ set/used. */
loop_depth = 1; loop_depth = 1;
for (insn = f; insn; insn = NEXT_INSN (insn)) for (index = 0; index < n_basic_blocks; index++)
{ {
/* Keep track of loop depth. */ basic_block bb = BASIC_BLOCK (index);
if (GET_CODE (insn) == NOTE) loop_depth = bb->loop_depth;
for (insn = bb->head; insn; insn = NEXT_INSN (insn))
{ {
/* Look for loop boundaries. */ if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END)
loop_depth -= loop_step;
else if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG)
loop_depth += loop_step;
/* If we have LOOP_DEPTH == 0, there has been a bookkeeping error.
Abort now rather than setting register status incorrectly. */
if (loop_depth == 0)
abort ();
}
else if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
{ {
rtx links; rtx links;
...@@ -5643,6 +5634,9 @@ recompute_reg_usage (f, loop_step) ...@@ -5643,6 +5634,9 @@ recompute_reg_usage (f, loop_step)
count_reg_references (XEXP (XEXP (note, 0), 0)); count_reg_references (XEXP (XEXP (note, 0), 0));
} }
} }
if (insn == bb->end)
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