On 12/16/2016 06:57 AM, Richard Biener wrote:
On Fri, Dec 16, 2016 at 2:54 AM, Jeff Law <l...@redhat.com> wrote:
+  /* 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);

So I'd use a once-per-pass allocated sbitmap here.  I don't see why you need
the orig_live_bytes bitmap though (just keep that implicitely by the known
range?)
So if we use a once-per-pass allocated bitmap, that actually facilitates returning a tri-state from dse_possible_dead_store_p and moving the trimming into dse_optimize_stmt.

ORIG_LIVE_BYTES was more convenience than anything -- we want it so that we can compute the dead bytes for trimming. But we can certainly compute it on-demand at that time.

Jeff

Reply via email to