On Tue, Jan 3, 2012 at 3:54 PM, Chris Lattner <clattner at apple.com> wrote:> > On Jan 2, 2012, at 9:42 PM, Jianzhou Zhao wrote: > >> Hi, >> >> Chapter 4 in http://llvm.org/pubs/2005-05-04-LattnerPHDThesis.html >> compares the precision of alias analysis in LLVM at that time. Does >> the latest LLVM still follow the similar results? I was also wondering >> how the globalmodred-aa and scev-aa that were not discussed in the PhD >> thesis are compared with others? Thanks and Happy New Year! > > Hi Jianzhou, > > That study is over 7 years old now. So much has changed that the results would surely have to be rerun. Among other things, SRoA is more aggressive than in those days, so many more of the "easy" alias pairs are already resolved. > > -ChrisI see. I asked the question because LLVM provides several alias analysis, and I was wondering how to decide which one should be used for compiling most programs. I think the basicaa is the default one, but by looking into its code, it is not inter-procedural or context-sensitive (I am not 100% sure), so does not provide interesting mod/ref information. Then, GVN(PRE) and LICM may not have a lot of opportunities for optimizing calls. So, I looked into the thesis for understanding how those inter-procedural aa and other aa contribute. I guess basicaa has a better speed-up per compiling-cost ratio for most common programs than others. Is this correct? -- Jianzhou
On Jan 3, 2012, at 1:53 PM, Jianzhou Zhao wrote:> I see. I asked the question because LLVM provides several alias > analysis, and I was wondering how to decide which one should be used > for compiling most programs. > > I think the basicaa is the default one, but by looking into its code, > it is not inter-procedural or context-sensitive (I am not 100% sure), > so does not provide interesting mod/ref information. Then, GVN(PRE) > and LICM may not have a lot of opportunities for optimizing calls. So, > I looked into the thesis for understanding how those inter-procedural > aa and other aa contribute. I guess basicaa has a better speed-up per > compiling-cost ratio for most common programs than others. Is this > correct?We do also use globalsmodref, and have a pass for inferring and propagating the readnone/readonly markers. We also now have Type Based Alias Analysis for C languages. No one has really been pushing forward aliasing much lately. -Chris
On Tue, Jan 3, 2012 at 4:55 PM, Chris Lattner <clattner at apple.com> wrote:> On Jan 3, 2012, at 1:53 PM, Jianzhou Zhao wrote: >> I see. I asked the question because LLVM provides several alias >> analysis, and I was wondering how to decide which one should be used >> for compiling most programs. >> >> I think the basicaa is the default one, but by looking into its code, >> it is not inter-procedural or context-sensitive (I am not 100% sure), >> so does not provide interesting mod/ref information. Then, GVN(PRE) >> and LICM may not have a lot of opportunities for optimizing calls. So, >> I looked into the thesis for understanding how those inter-procedural >> aa and other aa contribute. I guess basicaa has a better speed-up per >> compiling-cost ratio for most common programs than others. Is this >> correct? > > We do also use globalsmodref, and have a pass for inferring and propagating the readnone/readonly markers. We also now have Type Based Alias Analysis for C languages.I do not understand how the chaining works here. If I do opt -globalsmodref-aa ..., does the globalsmodref pass call the analysis implemented in AliasAnalysis or BasicAliasAnalysis class when globalsmodref cannot decide Must or No Alias? I think it should be AliasAnalysis, because globalsmodref subclasses AliasAnalysis. The documents say that all the aa analysis are chained, and give an example like opt -basicaa -ds-aa -licm. In this case, does ds-aa automatically call basicaa for the case when ds-aa can only return MayAlias? This looks magic to me. Is this handled by AnalysisGroup magically?> > No one has really been pushing forward aliasing much lately. > > -Chris >-- Jianzhou