[PATCH] NoAA does not initialize TargetLibraryInfo

Hal Finkel hfinkel at anl.gov
Tue May 27 10:38:08 PDT 2014


Hi,

@@ -37,6 +38,7 @@ namespace {

       // Note: NoAA does not call InitializeAliasAnalysis because it's

       // special and does not support chaining.

       TD = getAnalysisIfAvailable<DataLayout>();

+      TLI = getAnalysisIfAvailable<TargetLibraryInfo>();

     }

This I understand, and seems fine.

 void AliasAnalysis::InitializeAliasAnalysis(Pass *P) {

-  TD = P->getAnalysisIfAvailable<DataLayout>();

-  TLI = P->getAnalysisIfAvailable<TargetLibraryInfo>();

   AA = &P->getAnalysis<AliasAnalysis>();

+  // See NoAA::initializePass()

+  TD = AA->TD;

+  TLI = AA->TLI;

 }

This I don't understand. Why are you making this change? Won't it make AA crash if there are no AA providers?

 -Hal

----- Original Message -----
> From: "Tobias Güntner" <guentner at rbg.informatik.tu-darmstadt.de>
> To: "llvm-commits" <llvm-commits at cs.uiuc.edu>
> Sent: Monday, April 28, 2014 2:32:18 AM
> Subject: Re: [PATCH] NoAA does not initialize TargetLibraryInfo
> 
> Am 10.04.2014 19:13, schrieb Tobias Güntner:
> > Hi!
> >
> > I encountered a bug while implementing an AliasAnalysis. Basically,
> > I
> > passed the previous AA in the chain (which happened to be NoAA) to
> > a
> > helper function which returned a wrong result because
> > getTargetLibraryInfo() was NULL.
> >
> > With this patch, NoAA also initializes its TLI and all AAs in the
> > chain
> > use the same DataLayout and TargetLibraryInfo. (Patch is against
> > 3.4,
> > but should be straightforward to port.)
> >
> > Regards,
> > Tobias
> 
> ping
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory




More information about the llvm-commits mailing list