summaryrefslogtreecommitdiff
path: root/gcc/sbitmap.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-01 00:33:05 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-01 00:33:05 +0000
commit7d0585a5a37c8aac3712340f3bf964453ebc87b1 (patch)
treecd189cb08fa13a7f1b8b3f73f4d5e9b4b6f53621 /gcc/sbitmap.c
parenta4aade76261cf858be3bb15b085db257a4aa6035 (diff)
downloadgcc-7d0585a5a37c8aac3712340f3bf964453ebc87b1.tar.gz
* sbitmap.c (sbitmap_any_common_bits): New function.
* sbitmap.h (sbitmap_any_common_bits): Prototype. * modulo-sched.c (sms_schedule_by_order): Use sbitmap_any_common_bits No longer allocate/free "psp", "pss" sbitmaps. * tree-ssa-alias.c (compute_flow_insensitive_aliasing): Similarly for the "res" sbitmap. (group_aliases): Similarly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91550 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sbitmap.c')
-rw-r--r--gcc/sbitmap.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/sbitmap.c b/gcc/sbitmap.c
index f4abaeeba27..7c912a922af 100644
--- a/gcc/sbitmap.c
+++ b/gcc/sbitmap.c
@@ -316,6 +316,24 @@ sbitmap_difference (sbitmap dst, sbitmap a, sbitmap b)
*dstp++ = *ap++;
}
+/* Return true if there are any bits set in A are also set in B.
+ Return false otherwise. */
+
+bool
+sbitmap_any_common_bits (sbitmap a, sbitmap b)
+{
+ sbitmap_ptr ap = a->elms;
+ sbitmap_ptr bp = b->elms;
+ unsigned int i, n;
+
+ n = MIN (a->size, b->size);
+ for (i = 0; i < n; i++)
+ if ((*ap++ & *bp++) != 0)
+ return true;
+
+ return false;
+}
+
/* Set DST to be (A and B).
Return nonzero if any change is made. */