[llvm] [CodeGen][NPM] Avoid MachineModuleInfo in MachineModuleSlotTracker (PR #171257)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 18 10:05:30 PST 2025


================
@@ -48,10 +48,11 @@ class PrintMIRPass : public PassInfoMixin<PrintMIRPass> {
 /// Print LLVM IR using the MIR serialization format to the given output stream.
 LLVM_ABI void printMIR(raw_ostream &OS, const Module &M);
 
-/// Print a machine function using the MIR serialization format to the given
-/// output stream.
-LLVM_ABI void printMIR(raw_ostream &OS, const MachineModuleInfo &MMI,
-                       const MachineFunction &MF);
+/// This function supports both Legacy Pass Manager and New Pass Manager:
+/// - Legacy PM: Pass non-null \p MMI and null \p FAM
+/// - New PM: Pass null \p MMI and non-null \p FAM
+LLVM_ABI void printMIR(raw_ostream &OS, MachineModuleInfo *MMI,
+                       FunctionAnalysisManager *FAM, const MachineFunction &MF);
----------------
arsenm wrote:

I think it would make more sense to have a separate function for each than one that tries to handle both 

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


More information about the llvm-commits mailing list