-
-static void compute_antinout PROTO ((int, int_list_ptr *, sbitmap *,
- sbitmap *, sbitmap *, sbitmap *));
-static void compute_earlyinout PROTO ((int, int, int_list_ptr *, sbitmap *,
- sbitmap *, sbitmap *, sbitmap *));
-static void compute_delayinout PROTO ((int, int, int_list_ptr *, sbitmap *,
- sbitmap *, sbitmap *,
- sbitmap *, sbitmap *));
-static void compute_latein PROTO ((int, int, int_list_ptr *, sbitmap *,
- sbitmap *, sbitmap *));
-static void compute_isoinout PROTO ((int, int_list_ptr *, sbitmap *,
- sbitmap *, sbitmap *, sbitmap *));
-static void compute_optimal PROTO ((int, sbitmap *,
- sbitmap *, sbitmap *));
-static void compute_redundant PROTO ((int, int, sbitmap *,
- sbitmap *, sbitmap *, sbitmap *));
-
-/* Similarly, but for the reversed flowgraph. */
-static void compute_avinout PROTO ((int, int_list_ptr *, sbitmap *,
- sbitmap *, sbitmap *, sbitmap *));
-static void compute_fartherinout PROTO ((int, int, int_list_ptr *,
- sbitmap *, sbitmap *,
- sbitmap *, sbitmap *));
-static void compute_earlierinout PROTO ((int, int, int_list_ptr *, sbitmap *,
- sbitmap *, sbitmap *,
- sbitmap *, sbitmap *));
-static void compute_firstout PROTO ((int, int, int_list_ptr *, sbitmap *,
- sbitmap *, sbitmap *));
-static void compute_rev_isoinout PROTO ((int, int_list_ptr *, sbitmap *,
- sbitmap *, sbitmap *, sbitmap *));
-
-/* Given local properties TRANSP, ANTLOC, return the redundant and optimal
- computation points for expressions.
-
- To reduce overall memory consumption, we allocate memory immediately
- before its needed and deallocate it as soon as possible. */
-void
-pre_lcm (n_blocks, n_exprs, s_preds, s_succs, transp,
- antloc, redundant, optimal)
- int n_blocks;
- int n_exprs;
- int_list_ptr *s_preds;
- int_list_ptr *s_succs;
- sbitmap *transp;
- sbitmap *antloc;
- sbitmap *redundant;
- sbitmap *optimal;
-{
- sbitmap *antin, *antout, *earlyin, *earlyout, *delayin, *delayout;
- sbitmap *latein, *isoin, *isoout;
-
- /* Compute global anticipatability. ANTOUT is not needed except to
- compute ANTIN, so free its memory as soon as we return from
- compute_antinout. */
- antin = sbitmap_vector_alloc (n_blocks, n_exprs);
- antout = sbitmap_vector_alloc (n_blocks, n_exprs);
- compute_antinout (n_blocks, s_succs, antloc,
- transp, antin, antout);
- free (antout);
- antout = NULL;
-
- /* Compute earliestness. EARLYOUT is not needed except to compute
- EARLYIN, so free its memory as soon as we return from
- compute_earlyinout. */
- earlyin = sbitmap_vector_alloc (n_blocks, n_exprs);
- earlyout = sbitmap_vector_alloc (n_blocks, n_exprs);
- compute_earlyinout (n_blocks, n_exprs, s_preds, transp, antin,
- earlyin, earlyout);
- free (earlyout);
- earlyout = NULL;
-
- /* Compute delayedness. DELAYOUT is not needed except to compute
- DELAYIN, so free its memory as soon as we return from
- compute_delayinout. We also no longer need ANTIN and EARLYIN. */
- delayin = sbitmap_vector_alloc (n_blocks, n_exprs);
- delayout = sbitmap_vector_alloc (n_blocks, n_exprs);
- compute_delayinout (n_blocks, n_exprs, s_preds, antloc,
- antin, earlyin, delayin, delayout);
- free (delayout);
- delayout = NULL;
- free (antin);
- antin = NULL;
- free (earlyin);
- earlyin = NULL;
-
- /* Compute latestness. We no longer need DELAYIN after we compute
- LATEIN. */
- latein = sbitmap_vector_alloc (n_blocks, n_exprs);
- compute_latein (n_blocks, n_exprs, s_succs, antloc, delayin, latein);
- free (delayin);
- delayin = NULL;
-
- /* Compute isolatedness. ISOIN is not needed except to compute
- ISOOUT, so free its memory as soon as we return from
- compute_isoinout. */
- isoin = sbitmap_vector_alloc (n_blocks, n_exprs);
- isoout = sbitmap_vector_alloc (n_blocks, n_exprs);
- compute_isoinout (n_blocks, s_succs, antloc, latein, isoin, isoout);
- free (isoin);
- isoin = NULL;
-
- /* Now compute optimal placement points and the redundant expressions. */
- compute_optimal (n_blocks, latein, isoout, optimal);
- compute_redundant (n_blocks, n_exprs, antloc, latein, isoout, redundant);
- free (latein);
- latein = NULL;
- free (isoout);
- isoout = NULL;
-}
-
-/* Given local properties TRANSP, AVLOC, return the redundant and optimal
- computation points for expressions on the reverse flowgraph.
-
- To reduce overall memory consumption, we allocate memory immediately
- before its needed and deallocate it as soon as possible. */
-
-void
-pre_rev_lcm (n_blocks, n_exprs, s_preds, s_succs, transp,
- avloc, redundant, optimal)
- int n_blocks;
- int n_exprs;
- int_list_ptr *s_preds;
- int_list_ptr *s_succs;
- sbitmap *transp;
- sbitmap *avloc;
- sbitmap *redundant;
- sbitmap *optimal;
-{
- sbitmap *avin, *avout, *fartherin, *fartherout, *earlierin, *earlierout;
- sbitmap *firstout, *rev_isoin, *rev_isoout;
-
- /* Compute global availability. AVIN is not needed except to
- compute AVOUT, so free its memory as soon as we return from
- compute_avinout. */
- avin = sbitmap_vector_alloc (n_blocks, n_exprs);
- avout = sbitmap_vector_alloc (n_blocks, n_exprs);
- compute_avinout (n_blocks, s_preds, avloc, transp, avin, avout);
- free (avin);
- avin = NULL;
-
- /* Compute fartherness. FARTHERIN is not needed except to compute
- FARTHEROUT, so free its memory as soon as we return from
- compute_earlyinout. */
- fartherin = sbitmap_vector_alloc (n_blocks, n_exprs);
- fartherout = sbitmap_vector_alloc (n_blocks, n_exprs);
- compute_fartherinout (n_blocks, n_exprs, s_succs, transp,
- avout, fartherin, fartherout);
- free (fartherin);
- fartherin = NULL;
-
- /* Compute earlierness. EARLIERIN is not needed except to compute
- EARLIEROUT, so free its memory as soon as we return from
- compute_delayinout. We also no longer need AVOUT and FARTHEROUT. */
- earlierin = sbitmap_vector_alloc (n_blocks, n_exprs);
- earlierout = sbitmap_vector_alloc (n_blocks, n_exprs);
- compute_earlierinout (n_blocks, n_exprs, s_succs, avloc,
- avout, fartherout, earlierin, earlierout);
- free (earlierin);
- earlierin = NULL;
- free (avout);
- avout = NULL;
- free (fartherout);
- fartherout = NULL;
-
- /* Compute firstness. We no longer need EARLIEROUT after we compute
- FIRSTOUT. */
- firstout = sbitmap_vector_alloc (n_blocks, n_exprs);
- compute_firstout (n_blocks, n_exprs, s_preds, avloc, earlierout, firstout);
- free (earlierout);
- earlierout = NULL;
-
- /* Compute rev_isolatedness. ISOIN is not needed except to compute
- ISOOUT, so free its memory as soon as we return from
- compute_isoinout. */
- rev_isoin = sbitmap_vector_alloc (n_blocks, n_exprs);
- rev_isoout = sbitmap_vector_alloc (n_blocks, n_exprs);
- compute_rev_isoinout (n_blocks, s_preds, avloc, firstout,
- rev_isoin, rev_isoout);
- free (rev_isoout);
- rev_isoout = NULL;
-
- /* Now compute optimal placement points and the redundant expressions. */
- compute_optimal (n_blocks, firstout, rev_isoin, optimal);
- compute_redundant (n_blocks, n_exprs, avloc, firstout, rev_isoin, redundant);
- free (firstout);
- firstout = NULL;
- free (rev_isoin);
- rev_isoin = NULL;
-}
-
-/* Compute expression anticipatability at entrance and exit of each block. */