Skip to content

Callbacks to the CodeGen Pipeline via the New Pass Manager #78677

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Kamator opened this issue Jan 19, 2024 · 1 comment
Open

Callbacks to the CodeGen Pipeline via the New Pass Manager #78677

Kamator opened this issue Jan 19, 2024 · 1 comment
Labels
llvm:optimizations question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

Comments

@Kamator
Copy link

Kamator commented Jan 19, 2024

Hello!

[NPM="New Pass Manager", CGP="CodeGen Pipeline"]

As far as I understood it, the NPM only adds support to load passes via an external library to clang/opt/[...] that operate on a LLVM-IR unit, e.g. a Module. However, just recently a callback for a MachineFunctionPass was added - see #76320.

Reading the documentation, the reason why this was added is because some passes that operate on IR need to validate their result in the MIR representation of the Functions. This leads me to my first question:

  1. Are transformations of a MachineFunctionPass which gets loaded via a pass plugin and registered via PassBuilder::registerPipelineParsingCallback actually propagated to the resulting binary?

My guess is no - the MIR objects passed to the pass are JITed and discarded. If that is true, this leads me to my second question:

  1. Are there any plans to add similar registration points like PassBuilder::registerPipelineStartEPCallback which make it possible to run passes that are loaded via a pass plugin as part of the CGP?

Many thanks in advance, reading through the PRs and the evolution of the NPM was super interesting.

@EugeneZelenko EugeneZelenko added question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead! llvm:optimizations and removed new issue labels Jan 19, 2024
@paperchalice
Copy link
Contributor

  1. Are transformations of a MachineFunctionPass which gets loaded via a pass plugin and registered via PassBuilder::registerPipelineParsingCallback actually propagated to the resulting binary?

My guess is no - the MIR objects passed to the pass are JITed and discarded. If that is true, this leads me to my second question:

llc does not support plugins for NPM at the moment. If it support it in future, I think there is no different with opt...

  1. Are there any plans to add similar registration points like PassBuilder::registerPipelineStartEPCallback which make it possible to run passes that are loaded via a pass plugin as part of the CGP?

Currently, the proposed extension points are in #108690, but most of them are for backends.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
llvm:optimizations question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Projects
None yet
Development

No branches or pull requests

3 participants