diff options
author | Richard Biener <rguenther@suse.de> | 2019-11-25 07:48:48 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2019-11-25 07:48:48 +0000 |
commit | 5a34952edb758109a3b919bc149136ee9277ee3a (patch) | |
tree | e1c7bd72d45afac42b8f98d49cdb55b2f10707ec | |
parent | bceb7181c852f0829ff4b8b4c86bd949eceda7bf (diff) | |
download | gcc-5a34952edb758109a3b919bc149136ee9277ee3a.zip gcc-5a34952edb758109a3b919bc149136ee9277ee3a.tar.gz gcc-5a34952edb758109a3b919bc149136ee9277ee3a.tar.bz2 |
cfganal.c (pre_and_rev_post_order_compute_fn): Use an auto_bb_flag instead of an sbitmap for visited handling.
2019-11-25 Richard Biener <rguenther@suse.de>
* cfganal.c (pre_and_rev_post_order_compute_fn): Use an
auto_bb_flag instead of an sbitmap for visited handling.
From-SVN: r278666
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cfganal.c | 15 |
2 files changed, 13 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f37b986..a385d20 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-11-25 Richard Biener <rguenther@suse.de> + + * cfganal.c (pre_and_rev_post_order_compute_fn): Use an + auto_bb_flag instead of an sbitmap for visited handling. + 2019-11-25 Kewen Lin <linkw@gcc.gnu.org> * config/rs6000/vector.md (vector_fp_comparison_simple): New code diff --git a/gcc/cfganal.c b/gcc/cfganal.c index 039769d..1a5c720 100644 --- a/gcc/cfganal.c +++ b/gcc/cfganal.c @@ -967,11 +967,8 @@ pre_and_rev_post_order_compute_fn (struct function *fn, else rev_post_order_num -= NUM_FIXED_BLOCKS; - /* Allocate bitmap to track nodes that have been visited. */ - auto_sbitmap visited (last_basic_block_for_fn (fn)); - - /* None of the nodes in the CFG have been visited yet. */ - bitmap_clear (visited); + /* BB flag to track nodes that have been visited. */ + auto_bb_flag visited (fn); /* Push the first edge on to the stack. */ stack.quick_push (ei_start (ENTRY_BLOCK_PTR_FOR_FN (fn)->succs)); @@ -988,10 +985,10 @@ pre_and_rev_post_order_compute_fn (struct function *fn, /* Check if the edge destination has been visited yet. */ if (dest != EXIT_BLOCK_PTR_FOR_FN (fn) - && ! bitmap_bit_p (visited, dest->index)) + && ! (dest->flags & visited)) { /* Mark that we have visited the destination. */ - bitmap_set_bit (visited, dest->index); + dest->flags |= visited; if (pre_order) pre_order[pre_order_num] = dest->index; @@ -1032,6 +1029,10 @@ pre_and_rev_post_order_compute_fn (struct function *fn, rev_post_order[rev_post_order_num--] = ENTRY_BLOCK; } + /* Clear the temporarily allocated flag. */ + for (int i = 0; i < pre_order_num; ++i) + BASIC_BLOCK_FOR_FN (fn, rev_post_order[i])->flags &= ~visited; + return pre_order_num; } |