<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 3, 2015, at 4:21 AM, Vaivaswatha Nagaraj via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><div class="">Thank you both for the inputs. I've created a patch for the same, please review:<br class=""><a href="http://reviews.llvm.org/D15185" class="">http://reviews.llvm.org/D15185</a><br class=""><br class="">><span class="im"></span>You can specifically insert it into the pass pipeline, but in this case, we should just fix SLP to preserve the analysis.<br class=""></div>@Hal, I tried doing this but it didn't seem to work. I added the GlobalsAA pass right before GVN but it didn't seem to help. In retrospect, looking at the way pass manager works, it looks like it wasn't of much use. Since GlobalsAA is a ModulePass, and FunctionPasses that are scheduled even later are run first</div></div></div></blockquote><div><br class=""></div><div>I don’t expect this: the PassManager should honor the order you insert passes. </div><div>I confirmed with: opt -debug-pass=Structure -globals-aa -instcombine -slp-vectorizer -globals-aa -gvn</div><div><br class=""></div><div> ModulePass Manager<br class=""> CallGraph Construction<br class=""> Globals Alias Analysis<br class=""> FunctionPass Manager<br class=""> Basic Alias Analysis (stateless AA impl)<br class=""> Function Alias Analysis Results<br class=""> Dominator Tree Construction<br class=""> Combine redundant instructions<br class=""> Natural Loop Information<br class=""> Scalar Evolution Analysis<br class=""> Function Alias Analysis Results<br class=""> SLP Vectorizer<br class=""> CallGraph Construction<br class=""> Globals Alias Analysis<br class=""> FunctionPass Manager<br class=""> Dominator Tree Construction<br class=""> Basic Alias Analysis (stateless AA impl)<br class=""> Function Alias Analysis Results<br class=""> Memory Dependence Analysis<br class=""> Global Value Numbering<br class=""> Module Verifier<br class=""><br class=""></div><div><br class=""></div><div>— </div><div>Mehdi</div><div><br class=""></div><div><br class=""></div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="">, those FunctionPasses that invalidate it do so for good. I do not know if there is some other way to force it though.<br class=""><br class=""></div>Thanks,<br class=""></div><div class="gmail_extra"><br clear="all" class=""><div class=""><div class="gmail_signature"><div dir="ltr" class=""> - Vaivaswatha<br class=""></div></div></div>
<br class=""><div class="gmail_quote">On Thu, Dec 3, 2015 at 4:53 PM, Hal Finkel <span dir="ltr" class=""><<a href="mailto:hfinkel@anl.gov" target="_blank" class="">hfinkel@anl.gov</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">----- Original Message -----<br class="">
> From: "Vaivaswatha Nagaraj via llvm-dev" <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>><br class="">
> To: "James Molloy" <<a href="mailto:james@jamesmolloy.co.uk" class="">james@jamesmolloy.co.uk</a>><br class="">
> Cc: "LLVM Dev" <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>><br class="">
> Sent: Thursday, December 3, 2015 5:20:34 AM<br class="">
> Subject: Re: [llvm-dev] GlobalsAA from GVN<br class="">
><br class="">
> Hi James,<br class="">
><br class="">
> Thanks for the help. From the log, I could infer that SLP vectorizer<br class="">
> is not preserving alias analysis, preventing GVN from getting the<br class="">
> info. Although the first function to get compiled has GlobalsAA<br class="">
> available during GVN, rest of them do not as SLP vectorizer run on<br class="">
> that function invalidates GlobalsAA which is a module pass. Is there<br class="">
> a way to force re-computation of a particular analysis?<br class="">
<br class="">
</span>You can specifically insert it into the pass pipeline, but in this case, we should just fix SLP to preserve the analysis.<br class="">
<br class="">
-Hal<br class="">
<div class="HOEnZb"><div class="h5"><br class="">
><br class="">
> As a side note, I didn't have this problem on release_37.<br class="">
><br class="">
> Thanks a lot.<br class="">
><br class="">
> Regards,<br class="">
><br class="">
><br class="">
><br class="">
><br class="">
><br class="">
> - Vaivaswatha<br class="">
><br class="">
><br class="">
> On Thu, Dec 3, 2015 at 3:02 PM, James Molloy <<br class="">
> <a href="mailto:james@jamesmolloy.co.uk" class="">james@jamesmolloy.co.uk</a> > wrote:<br class="">
><br class="">
><br class="">
><br class="">
> Hi Vaivaswatha,<br class="">
><br class="">
><br class="">
> GlobalsAA is not an immutable pass because it needs to cache queries<br class="">
> to avoid them being unusably slow. It therefore relies on passes<br class="">
> explicitly preserving it. Most of the passes in the scalar pipeline<br class="">
> have been modified to setPreserved<GlobalsAA>() and I know the pass<br class="">
> gets preserved at least until LICM.<br class="">
><br class="">
><br class="">
> You can use -debug-pass=Executions to determine at what point<br class="">
> GlobalsAA is not preserved (which pass clobbers it) - you'd then<br class="">
> need to add GlobalsAA to its preserved pass list.<br class="">
><br class="">
><br class="">
> Cheers,<br class="">
><br class="">
><br class="">
> James<br class="">
><br class="">
><br class="">
><br class="">
><br class="">
> On Wed, 2 Dec 2015 at 09:35 Vaivaswatha Nagaraj via llvm-dev <<br class="">
> <a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a> > wrote:<br class="">
><br class="">
><br class="">
><br class="">
><br class="">
><br class="">
><br class="">
><br class="">
><br class="">
> Hi,<br class="">
><br class="">
> I've noticed that alias analysis queries arising from GVN do not use<br class="">
> the results from GlobalsAA.<br class="">
> The last call to AAResultsWrapperPass::runOnFunction() before GVN<br class="">
> does not add GlobalsAAWrapperPass due to unavailability. This leads<br class="">
> to the alias queries from GVN not having any globals mod-ref info.<br class="">
><br class="">
> Is this a known issue? and is there any way to have globals mod-ref<br class="">
> info available for GVN?<br class="">
><br class="">
> Thanks,<br class="">
><br class="">
><br class="">
><br class="">
><br class="">
><br class="">
><br class="">
><br class="">
><br class="">
> - Vaivaswatha<br class="">
> _______________________________________________<br class="">
> LLVM Developers mailing list<br class="">
> <a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="">
><br class="">
><br class="">
> _______________________________________________<br class="">
> LLVM Developers mailing list<br class="">
> <a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="">
><br class="">
<br class="">
</div></div><span class="HOEnZb"><font color="#888888" class="">--<br class="">
Hal Finkel<br class="">
Assistant Computational Scientist<br class="">
Leadership Computing Facility<br class="">
Argonne National Laboratory<br class="">
</font></span></blockquote></div><br class=""></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></body></html>