Skip to content

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

Open
@Kamator

Description

@Kamator

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    llvm:optimizationsquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions