aboutsummaryrefslogtreecommitdiff
path: root/gcc/flow.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2004-11-02 09:56:12 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2004-11-02 09:56:12 +0000
commit55994078b6bc51ae62bd4117c6c335b94336137b (patch)
tree01db73d0a68c2e2de0213a73d4f7c8d2b5d8ce66 /gcc/flow.c
parentf6219a5e9ca08b637e8e397eb33d7a515c9cfe7c (diff)
downloadgcc-55994078b6bc51ae62bd4117c6c335b94336137b.zip
gcc-55994078b6bc51ae62bd4117c6c335b94336137b.tar.gz
gcc-55994078b6bc51ae62bd4117c6c335b94336137b.tar.bz2
bitmap.h (bitmap_equal_p): Return bool.
* bitmap.h (bitmap_equal_p): Return bool. (bitmap_intersect_p, bitmap_intersect_compl_p): Declare. * bitmap.c (bitmap_equal_p): Return bool. Compare directly. (bitmap_intersect_p, bitmap_intersect_compl_p): New. * flow.c (calculate_global_regs_live): Use bitmap_intersect_p and bitmap_intersect_compl_p. * ifcvt (dead_or_predicable): Likewise. From-SVN: r89981
Diffstat (limited to 'gcc/flow.c')
-rw-r--r--gcc/flow.c48
1 files changed, 21 insertions, 27 deletions
diff --git a/gcc/flow.c b/gcc/flow.c
index 6e599c8..163e5c9 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -1185,38 +1185,32 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags)
rescan the block. This wouldn't be necessary if we had
precalculated local_live, however with PROP_SCAN_DEAD_CODE
local_live is really dependent on live_at_end. */
- CLEAR_REG_SET (tmp);
- rescan = bitmap_and_compl (tmp, bb->global_live_at_end,
- new_live_at_end);
-
- if (! rescan)
- {
- /* If any of the registers in the new live_at_end set are
- conditionally set in this basic block, we must rescan.
- This is because conditional lifetimes at the end of the
- block do not just take the live_at_end set into account,
- but also the liveness at the start of each successor
- block. We can miss changes in those sets if we only
- compare the new live_at_end against the previous one. */
- CLEAR_REG_SET (tmp);
- rescan = bitmap_and (tmp, new_live_at_end,
- bb->cond_local_set);
- }
-
- if (! rescan)
+ rescan = bitmap_intersect_compl_p (bb->global_live_at_end,
+ new_live_at_end);
+
+ if (!rescan)
+ /* If any of the registers in the new live_at_end set are
+ conditionally set in this basic block, we must rescan.
+ This is because conditional lifetimes at the end of the
+ block do not just take the live_at_end set into
+ account, but also the liveness at the start of each
+ successor block. We can miss changes in those sets if
+ we only compare the new live_at_end against the
+ previous one. */
+ rescan = bitmap_intersect_p (new_live_at_end,
+ bb->cond_local_set);
+
+ if (!rescan)
{
/* Find the set of changed bits. Take this opportunity
to notice that this set is empty and early out. */
- CLEAR_REG_SET (tmp);
- changed = bitmap_xor (tmp, bb->global_live_at_end,
- new_live_at_end);
- if (! changed)
+ bitmap_xor (tmp, bb->global_live_at_end, new_live_at_end);
+ if (bitmap_empty_p (tmp))
continue;
-
+
/* If any of the changed bits overlap with local_set,
- we'll have to rescan the block. Detect overlap by
- the AND with ~local_set turning off bits. */
- rescan = bitmap_and_compl_into (tmp, bb->local_set);
+ we'll have to rescan the block. */
+ rescan = bitmap_intersect_p (tmp, bb->local_set);
}
}