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

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 22 10:47:10 PDT 2024


================
@@ -76,6 +76,10 @@ struct MachinePassModel
 #endif
 
     auto PA = this->Pass.run(IR, AM);
+    // Machine function passes are not allowed to modify the LLVM
+    // representation, therefore we should preserve all IR analyses.
+    PA.template preserveSet<AllAnalysesOn<Module>>();
----------------
aeubanks wrote:

we shouldn't put this here because it's not required to go through a MachinePassModel to run a pass, you can always manually run a MachineFunctionPass.

as mentioned before, we should have a helper method similar to `getLoopPassPreservedAnalyses()` that every machine function pass must use as its return value

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


More information about the llvm-commits mailing list