gcse.c (compute_pre_ppinout): Zero initial ppout for all exit blocks...

* gcse.c (compute_pre_ppinout): Zero initial ppout for all
        exit blocks, and don't forward propogate into them either.
        * flow.c (add_pred_succ): Don't add duplicate edges.

From-SVN: r26931
This commit is contained in:
Richard Henderson 1999-05-13 17:33:31 -07:00 committed by Richard Henderson
parent 05c82e09de
commit 39dd4ec572
3 changed files with 45 additions and 15 deletions

View File

@ -1,3 +1,10 @@
Fri May 14 00:31:26 1999 Richard Henderson <rth@cygnus.com>
* gcse.c (compute_pre_ppinout): Zero initial ppout for all
exit blocks, and don't forward propogate into them either.
* flow.c (add_pred_succ): Don't add duplicate edges.
Sun Mar 14 02:38:07 PST 1999 Jeff Law (law@cygnus.com)
* egcs-1.1.2 Released.

View File

@ -3282,16 +3282,29 @@ add_pred_succ (pred_bb, succ_bb, s_preds, s_succs, num_preds, num_succs)
int *num_preds;
int *num_succs;
{
int_list_ptr tmp;
if (succ_bb != EXIT_BLOCK)
{
for (tmp = s_preds[succ_bb]; tmp; tmp = tmp->next)
if (tmp->val == pred_bb)
break;
if (tmp == NULL)
{
add_int_list_node (&pred_int_list_blocks, &s_preds[succ_bb], pred_bb);
num_preds[succ_bb]++;
}
}
if (pred_bb != ENTRY_BLOCK)
{
for (tmp = s_succs[pred_bb]; tmp; tmp = tmp->next)
if (tmp->val == succ_bb)
break;
if (tmp == NULL)
{
add_int_list_node (&pred_int_list_blocks, &s_succs[pred_bb], succ_bb);
num_succs[pred_bb]++;
}
}
}
/* Compute the predecessors and successors for each block. */

View File

@ -4146,12 +4146,18 @@ compute_pre_ppinout ()
int bb, i, changed, size, passes;
sbitmap_vector_ones (pre_ppin, n_basic_blocks);
/* ??? Inefficient as we set pre_ppin[0] twice, but simple. */
sbitmap_zero (pre_ppin[0]);
/* Placement Possible out is initially set on all except exit blocks.
That is, either blocks whose sole successor is exit, or who have no
successors at all, such as would be created by a function that does
not return. */
sbitmap_vector_ones (pre_ppout, n_basic_blocks);
/* ??? Inefficient as we set pre_ppout[n_basic_blocks-1] twice, but simple. */
sbitmap_zero (pre_ppout[n_basic_blocks - 1]);
for (bb = 0; bb < n_basic_blocks; bb++)
if (s_succs[bb] == NULL
|| (s_succs[bb]->next == NULL
&& s_succs[bb]->val == EXIT_BLOCK))
sbitmap_zero (pre_ppout[bb]);
size = pre_ppin[0]->size;
passes = 0;
@ -4171,8 +4177,9 @@ compute_pre_ppinout ()
for (i = 0; i < size; i++)
{
int_list_ptr pred;
SBITMAP_ELT_TYPE tmp = *antin & *pavin & (*antloc | (*transp & *ppout));
SBITMAP_ELT_TYPE pred_val = -1L;
SBITMAP_ELT_TYPE tmp, pred_val = -1L;
tmp = *antin & *pavin & (*antloc | (*transp & *ppout));
for (pred = s_preds[bb]; pred != NULL; pred = pred->next)
{
@ -4206,13 +4213,18 @@ compute_pre_ppinout ()
}
}
for (bb = 0; bb < n_basic_blocks - 1; bb++)
for (bb = 0; bb < n_basic_blocks; bb++)
{
sbitmap_ptr ppout = pre_ppout[bb]->elms;
for (i = 0; i < size; i++)
if (s_succs[bb] == NULL
|| (s_succs[bb]->next == NULL
&& s_succs[bb]->val == EXIT_BLOCK))
continue;
for (i = 0; i < size; i++, ppout++)
{
int_list_ptr succ;
int_list_ptr succ = s_succs[bb];
SBITMAP_ELT_TYPE tmp = -1L;
for (succ = s_succs[bb]; succ != NULL; succ = succ->next)
@ -4229,10 +4241,8 @@ compute_pre_ppinout ()
if (*ppout != tmp)
{
changed = 1;
*ppout++ = tmp;
*ppout = tmp;
}
else
ppout++;
}
}