<html><body>
<p><font size="2" face="sans-serif">Hi Hal,</font><br>
<br>
<font size="2" face="sans-serif">Thanks for the clarification.</font><br>
<br>
<tt><font size="2">Hal Finkel <hfinkel@anl.gov> wrote on 09/24/2014 06:42:10 PM:<br>
<br>
> From: Hal Finkel <hfinkel@anl.gov></font></tt><br>
<tt><font size="2">> To: Samuel F Antao/Watson/IBM@IBMUS</font></tt><br>
<tt><font size="2">> Cc: Tobias Grosser <tobias@grosser.es>, LLVM Dev <br>
> <llvmdev@cs.uiuc.edu>, Johannes Doerfert <doerfert@cs.uni-saarland.de></font></tt><br>
<tt><font size="2">> Date: 09/24/2014 06:42 PM</font></tt><br>
<tt><font size="2">> Subject: Re: [LLVMdev] noalias and alias.scope metadata producers</font></tt><br>
<tt><font size="2">> <br>
> ----- Original Message -----<br>
> > From: "Samuel F Antao" <sfantao@us.ibm.com><br>
> > To: "Johannes Doerfert" <doerfert@cs.uni-saarland.de><br>
> > Cc: "Tobias Grosser" <tobias@grosser.es>, "Samuel F Antao" <br>
> <sfantao@us.ibm.com>, "LLVM Dev" <llvmdev@cs.uiuc.edu><br>
> > Sent: Wednesday, September 24, 2014 3:28:25 PM<br>
> > Subject: Re: [LLVMdev] noalias and alias.scope metadata producers<br>
> > <br>
> > <br>
> > <br>
> > Hal, Johannes,<br>
> > <br>
> > <br>
> > Thanks for the feedback. I have been digging into this a little bit<br>
> > more and was able to have some of this metadata being generated.<br>
> > Nevertheless, I am confused about the semantics of this metadata.<br>
> > Let me explain:<br>
> > <br>
> > <br>
> > I was expecting the alias metadata to complement the information that<br>
> > alias analysis passes compute. However, it seems that the alias<br>
> > information of the pointers used in memory instructions is assumed<br>
> > to be different form the information of these instructions<br>
> > themselves. Let me give you an example:<br>
> > <br>
> > <br>
> > <br>
> > MayAlias: double* %arrayidx.i, double* %arrayidx6<br>
> > MayAlias: %4 = load double* %arrayidx.i, align 8, !tbaa !1,<br>
> > !alias.scope !7, !noalias !10 <-> store double %2, double*<br>
> > %arrayidx6, align 8, !tbaa !1<br>
> > <br>
> > <br>
> > becomes:<br>
> > <br>
> > <br>
> > <br>
> > MayAlias: double* %arrayidx.i, double* %arrayidx6<br>
> > NoAlias: %4 = load double* %arrayidx.i, align 8, !tbaa !1,<br>
> > !alias.scope !8, !noalias !5 <-> store double %2, double*<br>
> > %arrayidx6, align 8, !tbaa !1, !alias.scope !5, !noalias !8<br>
> > <br>
> > <br>
> > after I annotate the store using arrayidx6 as not aliasing with the<br>
> > load using arrayidx.i. Shouldn't the alias information of the memory<br>
> > instructions be propagated to the used pointers by the alias<br>
> > analysis pass?<br>
> <br>
> No, LLVM's current AA infrastructure does not do this kind of <br>
> backward inference from accesses to their pointers (you won't get <br>
> this from TBAA metadata either). Do you feel this would be useful?<br>
> </font></tt><br>
<br>
<tt><font size="2">My feeling is that the AliasAnalysis would be able to compute more accurate results if it propagates the information in the metadata. I see two advantages in doing that:</font></tt><br>
<br>
<tt><font size="2">From a development viewpoint, it would be nice to have the alias information centralized in a single class and avoid more complex schemes to combine metadata and analysis information. E.g. LICM, gets the Alias Analysis, loads the metadata and forward the information to the tracker that combines both. Maybe there is a good reason to use this scheme that I am not aware, but using AA only would be more elegant and easier to maintain. </font></tt><br>
<tt><font size="2">From a performance viewpoint, the ability to make AA as accurate as possible by propagating the metadata information may result in significant improvements. In particular for LLVM IR clients that can infer a lot of alias information from given language properties, they can use that to heavily annotate the code. In those cases AA would be almost irrelevant as the metadata contain most information.</font></tt><br>
<br>
<tt><font size="2">What do you think about this? If one thinks this is a good direction to go I'd be happy to help doing that.</font></tt><br>
<br>
<tt><font size="2">Thanks again,</font></tt><br>
<tt><font size="2">Samuel </font></tt><br>
<tt><font size="2"><br>
>  -Hal<br>
> <br>
> > Is this something that was not implemented (if so I'd<br>
> > be happy to work on this) or is my interpretation of the semantics<br>
> > wrong?<br>
> > <br>
> > <br>
> > Thanks again!<br>
> > Samuel<br>
> > <br>
> > <br>
> > <br>
> > <br>
> > 2014-09-19 21:34 GMT-04:00 Johannes Doerfert <<br>
> > doerfert@cs.uni-saarland.de > :<br>
> > <br>
> > <br>
> > Hey Samuel,<br>
> > <br>
> > I'm not sure if this is interesting for you but maybe it is:<br>
> > <br>
> > Polly can emit these metadata for loop nests we can analyze. It is<br>
> > based<br>
> > on runtime alias checks, thus versioning. We are currently fixing the<br>
> > bugs<br>
> > in the runtime alias check generation we merged yesterday but after<br>
> > that<br>
> > (or if you like earlier) I can submit the annotation patch for<br>
> > review.<br>
> > Some limited tests on polybench benchmarks (e.g., 3mm) without any<br>
> > polyhedral<br>
> > optimizations, thus only parallel and noalias annotations, showed up<br>
> > to<br>
> > 20% improvement.<br>
> > <br>
> > Best regards,<br>
> > Johannes<br>
> > <br>
> > <br>
> > <br>
> > On 09/19, Samuel F Antao wrote:<br>
> > > <br>
> > > <br>
> > > Hi all,<br>
> > > <br>
> > > In LLVM language reference I read that one can use noalias and<br>
> > > alias.scope<br>
> > > metadata to provide more detailed information about pointer<br>
> > > aliasing.<br>
> > > However, I was unable to obtain any LLVM IR annotations using this<br>
> > > metadata<br>
> > > from any LLVM optimization pass or Clang frontend (am I missing<br>
> > > something?).<br>
> > > <br>
> > > If I understand it correctly, this information would complement the<br>
> > > type-based alias information and whatever mechanisms the alias<br>
> > > analysis<br>
> > > passes in LLVM compute from the input program. I was wondering if<br>
> > > the<br>
> > > coverage provided by these two components is already acceptable or<br>
> > > if there<br>
> > > is work that can be done in LLVM IR clients like clang to provide<br>
> > > more<br>
> > > information with proper noalias and alias.scope annotations.<br>
> > > <br>
> > > Any comments?<br>
> > > <br>
> > > Thanks!<br>
> > > Samuel<br>
> > <br>
> > > _______________________________________________<br>
> > > LLVM Developers mailing list<br>
> > > LLVMdev@cs.uiuc.edu <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br>
> > > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
> > <br>
> > <br>
> > --<br>
> > <br>
> > Johannes Doerfert<br>
> > Researcher / PhD Student<br>
> > <br>
> > Compiler Design Lab (Prof. Hack)<br>
> > Saarland University, Computer Science<br>
> > Building E1.3, Room 4.26<br>
> > <br>
> > Tel. +49 (0)681 302-57521 : doerfert@cs.uni-saarland.de<br>
> > Fax. +49 (0)681 302-3065 :<br>
> > <a href="http://www.cdl.uni-saarland.de/people/doerfert">http://www.cdl.uni-saarland.de/people/doerfert</a><br>
> > <br>
> > _______________________________________________<br>
> > LLVM Developers mailing list<br>
> > LLVMdev@cs.uiuc.edu <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br>
> > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
> > <br>
> > <br>
> > <br>
> > _______________________________________________<br>
> > LLVM Developers mailing list<br>
> > LLVMdev@cs.uiuc.edu         <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br>
> > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
> > <br>
> <br>
> -- <br>
> Hal Finkel<br>
> Assistant Computational Scientist<br>
> Leadership Computing Facility<br>
> Argonne National Laboratory<br>
> </font></tt><br>
<tt><font size="2"><br>
</font></tt></body></html>