[PATCH] NoAA does not initialize TargetLibraryInfo

Tobias Güntner guentner at rbg.informatik.tu-darmstadt.de
Tue May 27 14:03:30 PDT 2014


Hi!

Am 27.05.2014 19:38, schrieb Hal Finkel:
>   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?

Both methods are almost identical. I wanted to remove duplicate code, 
but I didn't want to create yet another initialization method just for that.

> Won't it make AA crash if there are no AA providers?

No, because of the way alias analyses are chained. NoAA is the default 
AliasAnalysis; all others call AU.addRequired<AliasAnalysis>().

Regards,
Tobias



More information about the llvm-commits mailing list