<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 23, 2016 at 11:26 AM, Xinliang David Li <span dir="ltr"><<a href="mailto:davidxl@google.com" target="_blank">davidxl@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Aug 23, 2016 at 9:38 AM, Philip Reames<br>
<<a href="mailto:listmail@philipreames.com">listmail@philipreames.com</a>> wrote:<br>
> reames added a comment.<br>
><br>
> I just want to make sure I understand the big picture view of this change.  I'm going to try to summarize, please correct me if I'm wrong.<br>
><br>
> Today, we will walk back through the list of defs/clobbers provided by MDA (within a single block) without limit in DSE.  Internally, MDA will only find defs/clobbers which are within a limited distance of each other.  As a result, a series of adjacent clobbers will be scanned, but the same series of adjacent clobbers with a single long break of non-memory related instructions will not be.  Right?<br>
><br></span></blockquote><div><br></div><div>Let me directly answer this :)</div><div><br></div><div>The answer to phillip's question is "yes, you are right".</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<br>
</span>See below the small example that demonstrate the issue : opt  -S -dse<br>
-memdep-block-scan-limit=4 < dse.ll<br>
<br>
Suppose we look at g1 = 0 store and walk backwards to look for<br>
dependent access. Since the scan limit is set to 4 which is a little<br>
higher than the distance it needs walk to find a dependent memory<br>
access, a valid memLoc is returned. DSE then finds out that dependent<br>
memory is not removable, so it will continue walk up the dep-chain<br>
starting from where it stopped. In other words, it essentially<br>
bypassed the scan limit.<br></blockquote><div><br></div><div>No.</div><div>It's just a different limit.</div><div>The scan limit is maximum distance between a given starting pointer dependency and a clobber that it will walk.</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<br>
> With the patch, we will walk backwards a fixed distance (in number of instructions) considering any def/clobber we see in that window.<br>
<br>
</span>With this patch, we will remember the previous distance that we have<br>
walked and make sure the total distance is limited.<br></blockquote><div><br></div><div>Right, but that's a different limit.</div><div>It is, as phillip says, a window.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
><br>
> Is that a correct summary?<br>
><br>
> (p.s. Using the same default value from the original implementation with the new one seems highly suspect since the old implementation would have been much more aggressive in practice..)<br>
<br>
</span>This is of course tunable, but IMO, scan backward 100<br>
clobbering/aliased instructions in one basic block for every store<br>
instruction that is examined is already a pretty generous.<br></blockquote><div><br></div></div></div></div>