[llvm] r290449 - [PM] Add support for building a default AA pipeline to the PassBuilder.

Sean Silva via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 24 18:28:51 PST 2016


Looks good, thanks!

On Fri, Dec 23, 2016 at 9:22 PM, Chandler Carruth <chandlerc at gmail.com>
wrote:

> On Fri, Dec 23, 2016 at 6:44 PM Sean Silva via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>> On Fri, Dec 23, 2016 at 12:38 PM, Chandler Carruth via llvm-commits <
>> llvm-commits at lists.llvm.org> wrote:
>>
>> Author: chandlerc
>> Date: Fri Dec 23 14:38:19 2016
>> New Revision: 290449
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=290449&view=rev
>> Log:
>> [PM] Add support for building a default AA pipeline to the PassBuilder.
>>
>> Pretty boring and lame as-is but necessary. This is definitely a place
>> we'll end up with extension hooks longer term. =]
>>
>> Differential Revision: https://reviews.llvm.org/D28076
>>
>> Modified:
>>     llvm/trunk/include/llvm/Passes/PassBuilder.h
>>     llvm/trunk/lib/Passes/PassBuilder.cpp
>>     llvm/trunk/test/Other/new-pass-manager.ll
>>
>> Modified: llvm/trunk/include/llvm/Passes/PassBuilder.h
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
>> llvm/Passes/PassBuilder.h?rev=290449&r1=290448&r2=290449&view=diff
>> ============================================================
>> ==================
>> --- llvm/trunk/include/llvm/Passes/PassBuilder.h (original)
>> +++ llvm/trunk/include/llvm/Passes/PassBuilder.h Fri Dec 23 14:38:19 2016
>> @@ -224,6 +224,10 @@ public:
>>    ModulePassManager buildLTODefaultPipeline(OptimizationLevel Level,
>>                                              bool DebugLogging = false);
>>
>> +  /// Build the default `AAManager` with the default alias analysis
>> pipeline
>> +  /// registered.
>> +  AAManager buildDefaultAAPipeline();
>> +
>>    /// \brief Parse a textual pass pipeline description into a \c
>> ModulePassManager.
>>    ///
>>    /// The format of the textual pass pipeline description looks
>> something like:
>>
>> Modified: llvm/trunk/lib/Passes/PassBuilder.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Passes/
>> PassBuilder.cpp?rev=290449&r1=290448&r2=290449&view=diff
>> ============================================================
>> ==================
>> --- llvm/trunk/lib/Passes/PassBuilder.cpp (original)
>> +++ llvm/trunk/lib/Passes/PassBuilder.cpp Fri Dec 23 14:38:19 2016
>> @@ -544,6 +544,33 @@ ModulePassManager PassBuilder::buildLTOD
>>    return MPM;
>>  }
>>
>> +AAManager PassBuilder::buildDefaultAAPipeline() {
>> +  AAManager AA;
>> +
>> +  // The order in which these are registered determines their priority
>> when
>> +  // being queried.
>> +
>> +  // First we register the basic alias analysis that provides the
>> majority of
>> +  // per-function local AA logic. This is a stateless, on-demand local
>> set of
>> +  // AA techniques.
>> +  AA.registerFunctionAnalysis<BasicAA>();
>> +
>> +  // Next we query fast, specialized alias analyses that wrap IR-embedded
>> +  // information about aliasing.
>> +  AA.registerFunctionAnalysis<ScopedNoAliasAA>();
>> +  AA.registerFunctionAnalysis<TypeBasedAA>();
>> +
>> +  // Add support for querying global aliasing information when available.
>> +  // Because this is a module analysis this will use any cached analysis
>> state
>> +  // available but isn't enough to cause it to be available.
>> +  // FIXME: Enable once the invalidation logic supports this.
>>
>>
>> This comment is confusing. It starts out talking about how to cause the
>> analysis to be computed, but then the FIXME is about invalidation logic.
>> Can you somehow make it clear that they are talking about two different
>> things? (move the FIXME inside the `#if 0` maybe?).
>>
>> Also, for context about the "isn't enough to cause it to be available"
>> aspect, you probably want to emphasize that AAManager is a function
>> analysis and will access GlobalsAA through the proxy, which provides a
>> read-only view of the module analysis manager.
>>
>
> Thanks for reviewing! Attempted to do both in r290488, but if it still
> isn't working, just let me know.
>
> -Chandler
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161224/9d4fce9c/attachment.html>


More information about the llvm-commits mailing list