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

via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 22 19:33:20 PDT 2024


================
@@ -15,8 +16,7 @@ using namespace llvm;
 PreservedAnalyses
 FreeMachineFunctionPass::run(MachineFunction &MF,
                              MachineFunctionAnalysisManager &MFAM) {
-  auto &MMI = MF.getMMI();
-  MFAM.invalidate(MF, PreservedAnalyses::none());
-  MMI.deleteMachineFunctionFor(MF.getFunction()); // MF is dangling now.
-  return PreservedAnalyses::none();
+  PreservedAnalyses PA = PreservedAnalyses::none();
----------------
paperchalice wrote:

Yes, agreed we should just use function -> machine function adaptor. I also realized this when I refactor `CodeGenPassBuilder`. Will remove this option temporarily.

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


More information about the llvm-commits mailing list