<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 20, 2017 at 9:09 AM, Igor Laevsky via Phabricator <span dir="ltr"><<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">igor-laevsky added inline comments.<br>
<br>
<br>
================<br>
<span class="">Comment at: lib/Analysis/<wbr>BasicAliasAnalysis.cpp:886<br>
   // The AAResultBase base class has some smarts, lets use them.<br>
-  return AAResultBase::getModRefInfo(<wbr>CS, Loc);<br>
+  return static_cast<ModRefInfo>(Result & AAResultBase::getModRefInfo(<wbr>CS, Loc));<br>
 }<br>
----------------<br>
</span>dberlin wrote:<br>
> Uh?<br>
Idea here is to intersect smarts from AAResultBase with the result we've received in this function. I'm actually not certain if this is needed since "AAResults" does intersect results from all alias analyses. Plus AAResultBase currently doesn't have any smarts. So, yes, I'm not sure if we need this operation.<br>
<span class=""><br>
<br>
================<br>
Comment at: test/Transforms/NewGVN/<wbr>readattrs.ll:1-3<br>
-; XFAIL: *<br>
 ; RUN: opt -newgvn -S -o - < %s | FileCheck %s<br>
<br>
----------------<br>
</span><span class="">davide wrote:<br>
> The fact this test passes now is actually good, but I'd like to understand why it was failing before and now it's not. Can you please elaborate?<br>
</span>This test passes local non-escaping object as a readonly nocapture function argument. Before my change alias analysis would have ignored readonly argument and concluded that call modifies "%a". I suspect that old GVN might use some internal smarts to determine that "%a" is unmodified by the call, while NewGVN relies on the alias analysis.<br></blockquote><div><br></div><div>GVN uses memdep, which uses getmodrefinfo, the same as memoryssa (which newgvn uses).</div><div><br></div><div>I am going to analyze this further, as i believe it should already work as well in both cases ..</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
<a href="https://reviews.llvm.org/D29989" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D29989</a><br>
<br>
<br>
<br>
</blockquote></div><br></div></div>