Commit 168cbdf9 by Jeffrey A Law Committed by Jeff Law

haifa-sched.c (is_cfg_nonregular): Change return type to an int.

        * haifa-sched.c (is_cfg_nonregular): Change return type to
        an int.  No longer compute "estimated" number of edges.  Use
        computed_jump_p instead of duplicating the code.  Fixup/add
        some comments.
        (build_control_flow): Returns a value indicating an irregularity
        in the cfg was detected.  Count the number of edges in the cfg.
        allocate various edge tables.
        (find_rgns): No longer look for unreachable blocks.
        (schedule_insns): Do not allocate memory for edge tables here.
        Free memory for edge tables before returning.  Do not perform
        cross block scheduling if build_control_flow returns nonzero.
        * flow.c (compute_preds_succs): More accurately determine when
        a block drops in.
Fixes various compile hangs after haifa cleanup.

From-SVN: r18439
parent 52becdc0
Sat Mar 7 00:54:15 1998 Jeffrey A Law (law@cygnus.com) Sat Mar 7 00:54:15 1998 Jeffrey A Law (law@cygnus.com)
* haifa-sched.c (is_cfg_nonregular): Change return type to
an int. No longer compute "estimated" number of edges. Use
computed_jump_p instead of duplicating the code. Fixup/add
some comments.
(build_control_flow): Returns a value indicating an irregularity
in the cfg was detected. Count the number of edges in the cfg.
allocate various edge tables.
(find_rgns): No longer look for unreachable blocks.
(schedule_insns): Do not allocate memory for edge tables here.
Free memory for edge tables before returning. Do not perform
cross block scheduling if build_control_flow returns nonzero.
* flow.c (compute_preds_succs): More accurately determine when
a block drops in.
* basic-block.h (free_basic_block_vargs): Provide prototype. * basic-block.h (free_basic_block_vargs): Provide prototype.
* cccp.c (main): Fix dumb mistakes in last change. * cccp.c (main): Fix dumb mistakes in last change.
......
...@@ -3269,13 +3269,29 @@ compute_preds_succs (s_preds, s_succs, num_preds, num_succs) ...@@ -3269,13 +3269,29 @@ compute_preds_succs (s_preds, s_succs, num_preds, num_succs)
uid_block_number as needed. */ uid_block_number as needed. */
for (bb = 0; bb < n_basic_blocks; bb++) for (bb = 0; bb < n_basic_blocks; bb++)
{ {
rtx insn; rtx insn, stop_insn;
if (bb == 0)
stop_insn = NULL_RTX;
else
stop_insn = basic_block_end[bb-1];
/* Look backwards from the start of this block. Stop if we
hit the start of the function or the end of a previous
block. Don't walk backwards through blocks that are just
deleted insns! */
for (insn = PREV_INSN (basic_block_head[bb]); for (insn = PREV_INSN (basic_block_head[bb]);
insn && GET_CODE (insn) == NOTE; insn = PREV_INSN (insn)) insn && insn != stop_insn && GET_CODE (insn) == NOTE;
insn = PREV_INSN (insn))
; ;
basic_block_drops_in[bb] = insn && GET_CODE (insn) != BARRIER; /* Never set basic_block_drops_in for the first block. It is
implicit.
If we stopped on anything other than a BARRIER, then this
block drops in. */
if (bb != 0)
basic_block_drops_in[bb] = (insn ? GET_CODE (insn) != BARRIER : 1);
insn = basic_block_head[bb]; insn = basic_block_head[bb];
while (insn) while (insn)
...@@ -3286,9 +3302,8 @@ compute_preds_succs (s_preds, s_succs, num_preds, num_succs) ...@@ -3286,9 +3302,8 @@ compute_preds_succs (s_preds, s_succs, num_preds, num_succs)
insn = NEXT_INSN (insn); insn = NEXT_INSN (insn);
} }
} }
} }
for (bb = 0; bb < n_basic_blocks; bb++) for (bb = 0; bb < n_basic_blocks; bb++)
{ {
rtx head; rtx head;
...@@ -3300,8 +3315,14 @@ compute_preds_succs (s_preds, s_succs, num_preds, num_succs) ...@@ -3300,8 +3315,14 @@ compute_preds_succs (s_preds, s_succs, num_preds, num_succs)
for (jump = LABEL_REFS (head); for (jump = LABEL_REFS (head);
jump != head; jump != head;
jump = LABEL_NEXTREF (jump)) jump = LABEL_NEXTREF (jump))
add_pred_succ (BLOCK_NUM (CONTAINING_INSN (jump)), bb, {
s_preds, s_succs, num_preds, num_succs); if (! INSN_DELETED_P (CONTAINING_INSN (jump))
&& (GET_CODE (CONTAINING_INSN (jump)) != NOTE
|| (NOTE_LINE_NUMBER (CONTAINING_INSN (jump))
!= NOTE_INSN_DELETED)))
add_pred_succ (BLOCK_NUM (CONTAINING_INSN (jump)), bb,
s_preds, s_succs, num_preds, num_succs);
}
jump = BLOCK_END (bb); jump = BLOCK_END (bb);
/* If this is a RETURN insn or a conditional jump in the last /* If this is a RETURN insn or a conditional jump in the last
......
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