aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-sccvn.cc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2023-02-14 16:36:03 +0100
committerRichard Biener <rguenther@suse.de>2023-04-18 16:45:02 +0200
commitf548ece7abc0a0c81dd049e9f8b480ff2c38e18b (patch)
treeecc07baa36fc1db623123d0630409e2d4fcec4b7 /gcc/tree-ssa-sccvn.cc
parent2b53ac39bce7f6696332a8374205182a72ef2cb7 (diff)
downloadgcc-f548ece7abc0a0c81dd049e9f8b480ff2c38e18b.zip
gcc-f548ece7abc0a0c81dd049e9f8b480ff2c38e18b.tar.gz
gcc-f548ece7abc0a0c81dd049e9f8b480ff2c38e18b.tar.bz2
middle-end/108786 - add bitmap_clear_first_set_bit
This adds bitmap_clear_first_set_bit and uses it where previously bitmap_clear_bit followed bitmap_first_set_bit. The advantage is speeding up the search and avoiding to clobber ->current. PR middle-end/108786 * bitmap.h (bitmap_clear_first_set_bit): New. * bitmap.cc (bitmap_first_set_bit_worker): Rename from bitmap_first_set_bit and add optional clearing of the bit. (bitmap_first_set_bit): Wrap bitmap_first_set_bit_worker. (bitmap_clear_first_set_bit): Likewise. * df-core.cc (df_worklist_dataflow_doublequeue): Use bitmap_clear_first_set_bit. * graphite-scop-detection.cc (scop_detection::merge_sese): Likewise. * sanopt.cc (sanitize_asan_mark_unpoison): Likewise. (sanitize_asan_mark_poison): Likewise. * tree-cfgcleanup.cc (cleanup_tree_cfg_noloop): Likewise. * tree-into-ssa.cc (rewrite_blocks): Likewise. * tree-ssa-dce.cc (simple_dce_from_worklist): Likewise. * tree-ssa-sccvn.cc (do_rpo_vn_1): Likewise.
Diffstat (limited to 'gcc/tree-ssa-sccvn.cc')
-rw-r--r--gcc/tree-ssa-sccvn.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/tree-ssa-sccvn.cc b/gcc/tree-ssa-sccvn.cc
index 9692911..7fa2a15 100644
--- a/gcc/tree-ssa-sccvn.cc
+++ b/gcc/tree-ssa-sccvn.cc
@@ -8491,8 +8491,7 @@ do_rpo_vn_1 (function *fn, edge entry, bitmap exit_bbs,
bitmap_set_bit (worklist, 0);
while (!bitmap_empty_p (worklist))
{
- int idx = bitmap_first_set_bit (worklist);
- bitmap_clear_bit (worklist, idx);
+ int idx = bitmap_clear_first_set_bit (worklist);
basic_block bb = BASIC_BLOCK_FOR_FN (fn, rpo[idx]);
gcc_assert ((bb->flags & BB_EXECUTABLE)
&& !rpo_state[idx].visited);