<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/78677>78677</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Callbacks to the CodeGen Pipeline via the New Pass Manager
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Kamator
      </td>
    </tr>
</table>

<pre>
    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:

2. 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.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMlE-P2zYQxT8NfRmsIFGW_xx02D914jYOjG3Q-0gcS8xSpMohvfW3LyjZqZMiRS-2YZKP835vOMisO0tUi-pJVC8LjKF3vv4NBwzOLxqnLvVHMsYJWYDIX0T-eP2snj4fD6J8EVJ-pnc4IjMc0GJHXkgp5DM8fzjO689O0QeycNQjGW0prVcv92qPDCf0gAx7iFaR5-CcAh2STugJPh8P4Ky5ACrFwHEcnQ8QHBiHCkZkJoazRkAL9Fcgb9GA0Y1Hf0nbWoO2E3LnxiDkTlRPWZaJ6gVCjwHcSB4DgbOA8OnTH4eH_StEO99OWZcBwsGpaCiDj-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