[llvm-dev] registering passes at the beginning/end of opt passes (new pass manager)

Juneyoung Lee via llvm-dev llvm-dev at lists.llvm.org
Mon Dec 7 02:46:48 PST 2020


Okay, I tried something like this:

Given opt -passes='...', my bash script strips the quotes, puts
module(mypass) at the begin/end, put quotes again, and runs it. mypass is a
module-level pass.

ex) Given opt -passes='sroa' , it emits opt
-passes='module(mypass),sroa,module(mypass)'

The emitted command seems working in this case, but I found that it breaks
when loop-level passes are there:

ex) Running opt
-passes='module(mypass),loop(unswitch<nontrivial>),module(mypass)' shows:
build/bin/opt: invalid use of 'loop' pass as module pipeline


Is there a way to correctly add 'mypass' to the begin/end of the passes
regardless of the level of the pipeline?

Thanks,
Juneyoung

On Fri, Dec 4, 2020 at 1:28 PM Juneyoung Lee <juneyoung.lee at sf.snu.ac.kr>
wrote:

> Hello all,
>
> Can I register passes at the beginning/end of opt passes (new pass
> manager)?
>
> I found that
> registerPipelineStartEPCallback/registerOptimizerLastEPCallback work
> successfully for clang, but they don't fire when opt -passes="" is used.
>
> Thanks,
> Juneyoung
>
>

-- 

Juneyoung Lee
Software Foundation Lab, Seoul National University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20201207/8937dceb/attachment.html>


More information about the llvm-dev mailing list