[llvm] [NewPM][CodeGen] Add `MachineFunctionAnalysis` (PR #88610)

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 24 09:54:49 PDT 2024


================
@@ -152,10 +153,11 @@ int llvm::compileModuleWithNewPM(
     MPM.addPass(PrintMIRPreparePass(*OS));
     MachineFunctionPassManager MFPM;
     MFPM.addPass(PrintMIRPass(*OS));
-    MFPM.addPass(FreeMachineFunctionPass());
-    MPM.addPass(createModuleToMachineFunctionPassAdaptor(std::move(MFPM)));
+    FPM.addPass(createFunctionToMachineFunctionPassAdaptor(std::move(MFPM)));
+    FPM.addPass(InvalidateAnalysisPass<MachineFunctionAnalysis>());
----------------
aeubanks wrote:

this instance of invalidating machine functions isn't useful because we don't invalidate a machine function after running the pipeline on a machine function before moving onto the next machine function, but rather we invalidate all machine functions after running the pipeline on all machine functions. it needs to be in the function pass manager that also runs machine function passes to be useful

I don't think this is super important to have here since this is just for testing specific passes, I'd just drop it

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


More information about the llvm-commits mailing list