diff options
author | amacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-08-25 18:01:48 +0000 |
---|---|---|
committer | amacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-08-25 18:01:48 +0000 |
commit | cb7e28c369135e0ed896d8a5fd5efb40387e79c8 (patch) | |
tree | ba955e0fe6c71fda70442293df272f976fb43e4e /gcc/sbitmap.c | |
parent | 1408b4f1267c3ddc0f1765dcfc848d78cafad027 (diff) | |
download | gcc-cb7e28c369135e0ed896d8a5fd5efb40387e79c8.tar.gz |
Wed Aug 25 13:55:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com>
* sbitmap.h (sbitmap_intersection_of_succs): Add prototype.
(sbitmap_intersection_of_preds, sbitmap_union_of_succs,
sbitmap_union_of_preds): Add prototypes.
* sbitmap.c (sbitmap_intersection_of_succs): New function to compute
the intersection of successors with the new flow graph structures.
(sbitmap_intersection_of_preds): New function to compute the
intersection of predecessors with the new flow graph structures.
(sbitmap_union_of_succs): New function to compute the union of
successors with the new flow graph structures.
(sbitmap_union_of_preds): New function to compute the union of
predecessors with the new flow graph structures.
* gcse.c (compute_rdm, compute_available): Use new sbitmap routines.
(expr_reaches_here_p): Use edge and basic_block structures instead
of s_preds and s_succs.
(compute_cprop_avinout): Use new sbitmap routines.
(pre_expr_reaches_here_p): Use edge and basic_block structures instead
of s_preds and s_succs.
* flow.c (compute_flow_dominators): Compute dominators using
edges and basic blocks instead of s_preds and s_succs.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@28866 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sbitmap.c')
-rw-r--r-- | gcc/sbitmap.c | 160 |
1 files changed, 160 insertions, 0 deletions
diff --git a/gcc/sbitmap.c b/gcc/sbitmap.c index 2a417922300..89d6600927d 100644 --- a/gcc/sbitmap.c +++ b/gcc/sbitmap.c @@ -429,6 +429,166 @@ sbitmap_union_of_predsucc (dst, src, bb, pred_succ) } } +/* Set the bitmap DST to the intersection of SRC of successors of + block number BB, using the new flow graph structures. */ + +void +sbitmap_intersection_of_succs (dst, src, bb) + sbitmap dst; + sbitmap *src; + int bb; +{ + basic_block b = BASIC_BLOCK (bb); + edge e = b->succ; + int set_size = dst->size; + + for ( ; e != NULL; e = e->succ_next) + { + if (e->dest == EXIT_BLOCK_PTR) + continue; + sbitmap_copy (dst, src[e->dest->index]); + break; + } + if (e == NULL) + sbitmap_ones (dst); + else + { + for ( e = e->succ_next; e != NULL; e = e->succ_next) + { + int i; + sbitmap_ptr p,r; + + if (e->dest == EXIT_BLOCK_PTR) + continue; + + p = src[e->dest->index]->elms; + r = dst->elms; + for (i = 0; i < set_size; i++) + *r++ &= *p++; + } + } +} + +/* Set the bitmap DST to the intersection of SRC of predecessors of + block number BB, using the new flow graph structures. */ + +void +sbitmap_intersection_of_preds (dst, src, bb) + sbitmap dst; + sbitmap *src; + int bb; +{ + basic_block b = BASIC_BLOCK (bb); + edge e = b->pred; + int set_size = dst->size; + + for ( ; e != NULL; e = e->pred_next) + { + if (e->src== ENTRY_BLOCK_PTR) + continue; + sbitmap_copy (dst, src[e->src->index]); + break; + } + if (e == NULL) + sbitmap_ones (dst); + else + { + for ( e = e->pred_next; e != NULL; e = e->pred_next) + { + int i; + sbitmap_ptr p,r; + + if (e->src == ENTRY_BLOCK_PTR) + continue; + + p = src[e->src->index]->elms; + r = dst->elms; + for (i = 0; i < set_size; i++) + *r++ &= *p++; + } + } +} + +/* Set the bitmap DST to the union of SRC of successors of + block number BB, using the new flow graph structures. */ + +void +sbitmap_union_of_succs (dst, src, bb) + sbitmap dst; + sbitmap *src; + int bb; +{ + basic_block b = BASIC_BLOCK (bb); + edge e = b->succ; + int set_size = dst->size; + + for ( ; e != NULL; e = e->succ_next) + { + if (e->dest == EXIT_BLOCK_PTR) + continue; + sbitmap_copy (dst, src[e->dest->index]); + break; + } + if (e == NULL) + sbitmap_zero (dst); + else + { + for ( e = e->succ_next; e != NULL; e = e->succ_next) + { + int i; + sbitmap_ptr p,r; + + if (e->dest == EXIT_BLOCK_PTR) + continue; + + p = src[e->dest->index]->elms; + r = dst->elms; + for (i = 0; i < set_size; i++) + *r++ |= *p++; + } + } +} + +/* Set the bitmap DST to the union of SRC of predecessors of + block number BB, using the new flow graph structures. */ + +void +sbitmap_union_of_preds (dst, src, bb) + sbitmap dst; + sbitmap *src; + int bb; +{ + basic_block b = BASIC_BLOCK (bb); + edge e = b->pred; + int set_size = dst->size; + + for ( ; e != NULL; e = e->pred_next) + { + if (e->src== ENTRY_BLOCK_PTR) + continue; + sbitmap_copy (dst, src[e->src->index]); + break; + } + if (e == NULL) + sbitmap_zero (dst); + else + { + for ( e = e->pred_next; e != NULL; e = e->pred_next) + { + int i; + sbitmap_ptr p,r; + + if (e->src == ENTRY_BLOCK_PTR) + continue; + + p = src[e->src->index]->elms; + r = dst->elms; + for (i = 0; i < set_size; i++) + *r++ |= *p++; + } + } +} + void dump_sbitmap (file, bmap) FILE *file; |