aboutsummaryrefslogtreecommitdiff
path: root/gcc/sbitmap.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2004-11-30 17:33:05 -0700
committerJeff Law <law@gcc.gnu.org>2004-11-30 17:33:05 -0700
commit874437bca02e96899291027cfa3d6e4d4e08414f (patch)
treecd189cb08fa13a7f1b8b3f73f4d5e9b4b6f53621 /gcc/sbitmap.c
parent29b0a291d41c929c8b86f40da25071e09beeb7a6 (diff)
downloadgcc-874437bca02e96899291027cfa3d6e4d4e08414f.zip
gcc-874437bca02e96899291027cfa3d6e4d4e08414f.tar.gz
gcc-874437bca02e96899291027cfa3d6e4d4e08414f.tar.bz2
sbitmap.c (sbitmap_any_common_bits): New function.
* 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. From-SVN: r91550
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 f4abaee..7c912a9 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. */