summaryrefslogtreecommitdiff
path: root/gcc/lcm.c
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1999-11-11 09:21:12 +0000
committerJeff Law <law@gcc.gnu.org>1999-11-11 02:21:12 -0700
commitce72425040a624ab42466d60da50db9281221324 (patch)
tree62d2dd61bfefebccef8340515c5d9930c4e5d1f0 /gcc/lcm.c
parentcc2bd962dab4c5f4efddccca2e7beecf95102370 (diff)
downloadgcc-ce72425040a624ab42466d60da50db9281221324.tar.gz
flow.c (compute_flow_dominators): Initially put all blocks on the worklist.
* 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. From-SVN: r30484
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)
{