On 12/16/2016 12:29 AM, Trevor Saunders wrote:
On Thu, Dec 15, 2016 at 06:54:43PM -0700, Jeff Law wrote:
   unsigned cnt = 0;
+  bitmap live_bytes = NULL;
+  bitmap orig_live_bytes = NULL;

   *use_stmt = NULL;

+  /* REF is a memory write.  Go ahead and get its base, size, extent
+     information and encode the bytes written into LIVE_BYTES.  We can
+     handle any case where we have a known base and maximum size.
+
+     However, experimentation has shown that bit level tracking is not
+     useful in practice, so we only track at the byte level.
+
+     Furthermore, experimentation has shown that 99% of the cases
+     that require byte tracking are 64 bytes or less.  */
+  if (valid_ao_ref_for_dse (ref)
+      && (ref->max_size / BITS_PER_UNIT
+         <= PARAM_VALUE (PARAM_DSE_MAX_OBJECT_SIZE)))
+    {
+      live_bytes = BITMAP_ALLOC (NULL);
+      orig_live_bytes = BITMAP_ALLOC (NULL);
+      bitmap_set_range (live_bytes,
+                       ref->offset / BITS_PER_UNIT,
+                       ref->max_size / BITS_PER_UNIT);
+      bitmap_copy (orig_live_bytes, live_bytes);

would it maybe make sense to use sbitmaps since the length is known to
be short, and doesn't change after allocation?
New version will use auto_sbitmap and sbitmaps.

Jeff

Reply via email to