<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:11pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<div id="divtagdefaultwrapper" style="font-size: 11pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" dir="ltr">
<p style="margin-top:0;margin-bottom:0"></p>
<div>OK. Good stuff. Thanks for the info. Compile times I can do. <span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 14.6667px;">The
 results don't look awful, so long as you squint a little :) They are not too bad, and hopefully we can make them a little better from here.</span></div>
<div><br>
</div>
<div><span style="font-size: 14.6667px;">I'll try and clean up what I have right now and report on these compile time numbers. Watch this space.</span><br>
</div>
<div><br>
</div>
<div>Cheers for the info,</div>
<div>Dave</div>
<br>
<p></p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Daniel Berlin <dberlin@dberlin.org><br>
<b>Sent:</b> 05 December 2017 04:30:54<br>
<b>To:</b> David Green<br>
<b>Cc:</b> reviews+D40480+public+ec7e4dc10b50dfd8@reviews.llvm.org; Javed Absar; Piotr Padlewski; George Burgess IV; Friedman, Eli; Davide Italiano; llvm-commits@xorshift.org; llvm-commits<br>
<b>Subject:</b> Re: [PATCH] D40480: MemorySSA backed Dead Store Elimination.</font>
<div> </div>
</div>
<div>
<div dir="ltr">And note, obviously, you should do speed testing to see how slow it is right now.  
<div><br>
</div>
<div>I'm happy to approve this DSE if it's better, for sure.</div>
<div><br>
</div>
<div>But every time i see random limits like you have, i get very very worried.
<div>The cases where we should not be able to perform basic memory optimizations like DSE should be incredibly large. I'm aware we currently limit it through memdep and other things.  I'm not even saying it's your problem. But it is worrying to me ;)</div>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
<div class="x_gmail_extra"><br>
<div class="x_gmail_quote">On Mon, Dec 4, 2017 at 11:09 AM, Daniel Berlin <span dir="ltr">
<<a href="mailto:dberlin@dberlin.org" target="_blank">dberlin@dberlin.org</a>></span> wrote:<br>
<blockquote class="x_gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr"><br>
<div class="x_gmail_extra">Nope, you are right, part of this is giving up in some cases for removing a factor of O(uses) from most checks. But there is more to extract from what it is telling you that *isn't* doing that.</div>
<div class="x_gmail_extra"><br>
</div>
<div class="x_gmail_extra"><br>
</div>
<div class="x_gmail_extra">Remember that what it's really telling you is that "any def in between the use and the def it's linked to is no-alias of the use".</div>
<div class="x_gmail_extra"><br>
</div>
<div class="x_gmail_extra">So, given, for example:</div>
<span class="">
<div class="x_gmail_extra"><br>
<span style="font-size:12.8px">define i32 @test(i32* %P, i32 %y) {</span><br style="font-size:12.8px">
<span class="x_m_929378780920427825gmail-m_-8835095014217447538gmail-im" style="font-size:12.8px">; 1 = MemoryDef(liveOnEntry)<br>
  store i32 1, i32* %P<br>
</span><span style="font-size:12.8px">  %Py = getelementptr i32, i32* %P, i32 %y</span><br style="font-size:12.8px">
<span style="font-size:12.8px">; 2 = MemoryDef(1)</span><br style="font-size:12.8px">
<span style="font-size:12.8px">  store i32 2, i32* %Py</span></div>
</span>
<div class="x_gmail_extra"><span style="font-size:12.8px">; 3 = MemoryDef(2)</span><span class=""><br style="font-size:12.8px">
<span style="font-size:12.8px">  store i32 1, i32* %P</span></span></div>
<div class="x_gmail_extra"><span class=""><span style="font-size:12.8px">  %P1 = getelementptr i32, i32* %P, i32 1</span><br style="font-size:12.8px">
</span><span class=""><span style="font-size:12.8px">; MemoryUse(2)</span><br style="font-size:12.8px">
<span style="font-size:12.8px">  %l = load i32, i32* %P1</span><br style="font-size:12.8px">
</span><span style="font-size:12.8px">  ret i32 %l</span><br style="font-size:12.8px">
<span style="font-size:12.8px">}</span><br>
</div>
<div class="x_gmail_extra"><span style="font-size:12.8px"><br>
</span></div>
<div class="x_gmail_extra"><span style="font-size:12.8px"><br>
</span></div>
<div class="x_gmail_extra"><span style="font-size:12.8px">This proves that MemoryUse(2) cannot affect the store at 1.  If it could, it would have been MemoryUse(3) instead.</span></div>
<div class="x_gmail_extra"><span style="font-size:12.8px">MemorySSA already figured this out for you, and currently, you will rediscover it.  In fact, it's better than that, because in just about all cases outside of the pair metadata i referred to earlier,
 seeing this proves it "for all time" (IE you don't have to ever forget this information)</span></div>
<div class="x_gmail_extra"><br>
</div>
<div class="x_gmail_extra"><span style="font-size:12.8px">IE your statement "</span><span style="font-size:12.8px"> </span><span style="font-size:12.8px">If SI->Current is NoAlias we can't safely treat SI->Use as noalias though."</span></div>
<div class="x_gmail_extra"><span style="font-size:12.8px"><br>
</span></div>
<div class="x_gmail_extra"><span style="font-size:12.8px">This is true in general, but false if a store with the same loc is in between Si->Use and SI->getDefiningAccess()</span></div>
<div class="x_gmail_extra"><span style="font-size:12.8px"><br>
</span></div>
<div class="x_gmail_extra"><span style="font-size:12.8px">You can use OrderedInstructions or something to see if that's the case.</span></div>
<div class="x_gmail_extra"><br>
</div>
<div class="x_gmail_extra"><span style="font-size:12.8px">So basically all i'm asking is that you use the information it's providing you if you can :)</span></div>
<div class="x_gmail_extra"><span style="font-size:12.8px">The information it's providing is that "given a use, the use may/must alias with it's def. Anything in between the use and it's current def must be noalias".</span></div>
<div class="x_gmail_extra"><br>
</div>
<div class="x_gmail_extra"><span style="font-size:12.8px"><br>
</span></div>
<div class="x_gmail_extra">
<div class="x_gmail_quote">
<div><br>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose,
 or store or copy the information in any medium. Thank you.
</body>
</html>