[llvm] [CodeGen] Port PrintMIR to new pass manager (PR #79440)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 25 05:31:00 PST 2024


paperchalice wrote:

It is also possible to convert this pass to a normal IR module pass which uses `MachineModuleAnalysis` or "machine module pass" which is also supported by `MachineFunctionPassManager`, but IMHO we should avoid machine module pass, and treat machine module pass as normal module pass.

Currently there are two kinds machine module pass, debugify and machine outliner. For debugify passes, I plan to move them to codegen instrumentation, but to my surprise these passes will modify IR, although machine function passes should not modify the IR. Seems there is a "new" non-instr debug-info, not sure how this will affect MIR and related passes.

For machine outliner, just let it be a module pass and interrupt the machine function pass pipeline, then we need a `ModuleToMachineFunctionPassAdaptor`. This can also help us to avoid the `doFinalization` in `AsmPrinter`, it is in fact a  IR pass.

https://github.com/llvm/llvm-project/pull/79440


More information about the llvm-commits mailing list