<div style="font-family:arial,helvetica,sans-serif;font-size:10pt">On 8 December 2012 10:12, Hal Finkel <span dir="ltr"><<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>></span> wrote:<br><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Nick,<br>
<br>
You had okayed the previous version of this. Would you like to look at this one as well?<br></blockquote><div><br></div><div>Thanks for the ping!</div><div><br></div><div>I took a look, and I must be missing something. Won't this miscompile:</div>

<div><br></div><div>bb2:</div><div>  %pn1 = phi i8* [ %x, %bb1 ], [ %y, %bb2 ]</div><div>  %pn2 = phi i8* [ %z, %bb1 ], [ %pn1, %bb2 ]</div><div><br></div><div>when %x, %y and %z are all NoAlias? It will speculate that %pn1 and %pn2 don't alias and the proceed to confirm that just because it speculated it.</div>

<div><br></div><div>Nick</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
 -Hal<br>
</font></span><div class="im HOEnZb"><br>
----- Original Message -----<br>
> From: "Dan Gohman" <<a href="mailto:dan433584@gmail.com">dan433584@gmail.com</a>><br>
> To: "Hal Finkel" <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>><br>
> Cc: "Arnold Schwaighofer" <<a href="mailto:arnold.schwaighofer@gmail.com">arnold.schwaighofer@gmail.com</a>>, "Commit Messages and Patches for LLVM"<br>
> <<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a>><br>
</div><div class="HOEnZb"><div class="h5">> Sent: Thursday, December 6, 2012 4:32:32 PM<br>
> Subject: Re: [llvm-commits] [PATCH] Optimistically analyse phi cycles in BasicAA<br>
><br>
> The basic idea sounds fine.<br>
><br>
> Dan<br>
><br>
> On Thu, Dec 6, 2012 at 9:31 AM, Hal Finkel <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>> wrote:<br>
> > Dan,<br>
> ><br>
> > Do you have an opinion on this?<br>
> ><br>
> > Thanks again,<br>
> > Hal<br>
> ><br>
> > ----- Original Message -----<br>
> >> From: "Arnold Schwaighofer" <<a href="mailto:arnold.schwaighofer@gmail.com">arnold.schwaighofer@gmail.com</a>><br>
> >> Cc: "Commit Messages and Patches for LLVM"<br>
> >> <<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a>><br>
> >> Sent: Wednesday, November 21, 2012 9:24:13 AM<br>
> >> Subject: Re: [llvm-commits] [PATCH] Optimistically analyse phi<br>
> >> cycles in      BasicAA<br>
> >><br>
> >> Also send to list ...<br>
> >><br>
> >> On Wed, Nov 21, 2012 at 3:37 AM, Duncan Sands <<a href="mailto:baldrick@free.fr">baldrick@free.fr</a>><br>
> >> wrote:<br>
> >> ><br>
> >> > what happens if the recursion bails out due to hitting a<br>
> >> > recursion<br>
> >> > limit?<br>
> >> > Will the conservatively correct MayAlias be returned in that<br>
> >> > case?<br>
> >><br>
> >> Yes, because when we hit the limit in the recursion we return<br>
> >> MayAlias<br>
> >> from this recursion. This result will be merged with the phi's<br>
> >> alias<br>
> >> result, setting the phi to MayAlias.<br>
> >><br>
> >>       AliasResult Alias = NoAlias;<br>
> >>       AliasResult OrigAliasResult = AliasCache[Locs]; // Is<br>
> >>       MayAlias<br>
> >> if we have never seen this node.<br>
> >>       AliasCache[Locs] = NoAlias;<br>
> >><br>
> >>       for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e;<br>
> >>       ++i) {<br>
> >>         AliasResult ThisAlias =<br>
> >>                      [1]<br>
> >>           aliasCheck(PN->getIncomingValue(i), PNSize, PNTBAAInfo,<br>
> >>                      PN2->getIncomingValueForBlock(PN->getIncomingBlock(i)),<br>
> >>                      V2Size, V2TBAAInfo);<br>
> >>         Alias = MergeAliasResults(ThisAlias, Alias);<br>
> >>         if (Alias == MayAlias)<br>
> >>           break;<br>
> >>       }<br>
> >><br>
> >>       // Reset if speculation failed.<br>
> >>       if (Alias != NoAlias)<br>
> >>         AliasCache[Locs] = OrigAliasResult;<br>
> >><br>
> >> We either process all nodes in the phis' input graph and<br>
> >> eventually<br>
> >> see a MayAlias result or we give up early and return MayAlias<br>
> >> through<br>
> >> the recursion.<br>
> >> The interesting case when we handle two phi nodes. We assume the<br>
> >> phis<br>
> >> to be NoAlias and they are not. Let say we process all inputs<br>
> >> recursively then we eventually will see an input that is MayAlias,<br>
> >> this will be propagate up to the call aliasCheck [1] above,<br>
> >> resulting<br>
> >> in the phi to be set to MayAlias.<br>
> >> In the case were we hit the recursion limit this again will happen<br>
> >> in<br>
> >> the call to aliasCheck [1] which then returns MayAlias and again<br>
> >> the<br>
> >> phis' result will be reset to MayAlias.<br>
> >> _______________________________________________<br>
> >> llvm-commits mailing list<br>
> >> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> >> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
> >><br>
> ><br>
> > --<br>
> > Hal Finkel<br>
> > Postdoctoral Appointee<br>
> > Leadership Computing Facility<br>
> > Argonne National Laboratory<br>
><br>
<br>
--<br>
Hal Finkel<br>
Postdoctoral Appointee<br>
Leadership Computing Facility<br>
Argonne National Laboratory<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div>