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

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


================
@@ -327,14 +332,29 @@ bool MIRParserImpl::parseMachineFunction(Module &M, MachineModuleInfo &MMI) {
                    "' isn't defined in the provided LLVM IR");
     }
   }
-  if (MMI.getMachineFunction(*F) != nullptr)
-    return error(Twine("redefinition of machine function '") + FunctionName +
-                 "'");
 
-  // Create the MachineFunction.
-  MachineFunction &MF = MMI.getOrCreateMachineFunction(*F);
-  if (initializeMachineFunction(YamlMF, MF))
-    return true;
+  if (!MAM) {
+    if (MMI.getMachineFunction(*F) != nullptr)
+      return error(Twine("redefinition of machine function '") + FunctionName +
+                   "'");
+
+    // Create the MachineFunction.
+    MachineFunction &MF = MMI.getOrCreateMachineFunction(*F);
+    if (initializeMachineFunction(YamlMF, MF))
+      return true;
+  } else {
+    auto &FAM =
----------------
aeubanks wrote:

can we directly pass `FunctionAnalysisManager` to `parseMachineFunctions`?

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


More information about the llvm-commits mailing list