[llvm-dev] RFC: PassManager extensions

Friedman, Eli via llvm-dev llvm-dev at lists.llvm.org
Mon Sep 17 11:52:37 PDT 2018


On 9/17/2018 10:35 AM, David Greene via llvm-dev wrote:
> Extension points were a great addition to the PassManager
> infrastructure.  I'm just starting to learn about the new PassManager
> and am reading Bekket McClane's great series about it.
>
> For a long time I've written passes and then hacked up
> PassManagerBuilder and friends to add it to the pipeline.  Then
> extensions came along.  Now I don't need to hack PassManagerBuilder
> directly but I do need to hack the thing that sets up extensions.  For
> example, opt.cpp has a call to Coroutines helpers so Coroutines can
> insert its passes in the pipeline using the extension mechanism.  The
> Coroutines authors had to modify opt.cpp directly to use their in-tree
> pass.
>
> It strikes me that we are very close to having a mechanism to better
> encapsulate how a pass gets added to the pipeline.  We already have code
> in each pass' sources that registers the pass with the PassManager.
> What if, during registration, a callback was made to the pass being
> registered which would allow the pass to add itself to the pipeline
> using the extension mechanism?  Then all of the code to add a pass to
> the pipeline would be neatly contained in the pass' own sources, without
> the need to hack up unrelated code.

How is what you're asking for different from llvm::RegisterStandardPasses?

-Eli

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project



More information about the llvm-dev mailing list