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

Arthur Eubanks via llvm-dev llvm-dev at lists.llvm.org
Thu Dec 3 23:25:56 PST 2020


There are various opt options [1] that let you specify passes to add at
specific points in the pipeline. Also, specifying a target may cause the
corresponding TargetMachine to register pass callbacks.
Something like "-passes=default<O2>" that creates a full pipeline will add
those passes to the pipeline. Otherwise they aren't invoked.

[1]:
https://github.com/llvm/llvm-project/blob/f5f1a5c2448e31f3c7e6f85b378372a02f8d3e43/llvm/tools/opt/NewPMDriver.cpp#L73

On Thu, Dec 3, 2020 at 8:29 PM Juneyoung Lee via llvm-dev <
llvm-dev at lists.llvm.org> 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
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20201203/c125f193/attachment.html>


More information about the llvm-dev mailing list