summaryrefslogtreecommitdiff
path: root/gcc/lcm.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1999-11-11 09:21:12 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1999-11-11 09:21:12 +0000
commit5d6931e29ee7cb59ea24bcbc315023345869b0c2 (patch)
tree62d2dd61bfefebccef8340515c5d9930c4e5d1f0 /gcc/lcm.c
parented50b7b8aed0b302381891b33faff9bdff3ff1af (diff)
downloadgcc-5d6931e29ee7cb59ea24bcbc315023345869b0c2.tar.gz
* flow.c (compute_flow_dominators): Initially put all blocks on
the worklist. * lcm.c (compute_antinout_edge, compute_available): Similarly. * gcse.c (compute_cprop_avinout): Remove. (compute_cprop_data): Use compute_available. (delete_null_pointer_checks_1): Use compute_available. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30484 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lcm.c')
-rw-r--r--gcc/lcm.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/gcc/lcm.c b/gcc/lcm.c
index 4df804060af..12a16ed87c0 100644
--- a/gcc/lcm.c
+++ b/gcc/lcm.c
@@ -112,17 +112,19 @@ compute_antinout_edge (antloc, transp, antin, antout)
ANTIN. */
sbitmap_vector_ones (antin, n_basic_blocks);
- /* Put the predecessors of the exit block on the worklist. */
- for (e = EXIT_BLOCK_PTR->pred; e; e = e->pred_next)
+ /* Put every block on the worklist; this is necessary because of the
+ optimistic initialization of ANTIN above. */
+ for (bb = 0; bb < n_basic_blocks; bb++)
{
- *tos++ = e->src;
-
- /* We use the block's aux field to track blocks which are in
- the worklist; we also use it to quickly determine which blocks
- are predecessors of the EXIT block. */
- e->src->aux = EXIT_BLOCK_PTR;
+ *tos++ = BASIC_BLOCK (bb);
+ BASIC_BLOCK (bb)->aux = BASIC_BLOCK (bb);
}
+ /* Mark blocks which are predecessors of the exit block so that we
+ can easily identify them below. */
+ for (e = EXIT_BLOCK_PTR->pred; e; e = e->pred_next)
+ e->src->aux = EXIT_BLOCK_PTR;
+
/* Iterate until the worklist is empty. */
while (tos != worklist)
{
@@ -467,17 +469,19 @@ compute_available (avloc, kill, avout, avin)
/* We want a maximal solution. */
sbitmap_vector_ones (avout, n_basic_blocks);
- /* Put the successors of the entry block on the worklist. */
- for (e = ENTRY_BLOCK_PTR->succ; e; e = e->succ_next)
+ /* Put every block on the worklist; this is necessary because of the
+ optimistic initialization of AVOUT above. */
+ for (bb = n_basic_blocks - 1; bb >= 0; bb--)
{
- *tos++ = e->dest;
-
- /* We use the block's aux field to track blocks which are in
- the worklist; we also use it to quickly determine which blocks
- are successors of the ENTRY block. */
- e->dest->aux = ENTRY_BLOCK_PTR;
+ *tos++ = BASIC_BLOCK (bb);
+ BASIC_BLOCK (bb)->aux = BASIC_BLOCK (bb);
}
+ /* Mark blocks which are successors of the entry block so that we
+ can easily identify them below. */
+ for (e = ENTRY_BLOCK_PTR->succ; e; e = e->succ_next)
+ e->dest->aux = ENTRY_BLOCK_PTR;
+
/* Iterate until the worklist is empty. */
while (tos != worklist)
{