[llvm] [NewPM][CodeGen] Add `FunctionToMachineFunctionAnalysis` (PR #88610)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 22 19:24:06 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 =
----------------
paperchalice wrote:
It need `MachineModuleInfo` to initialize `MachineFunction`.
https://github.com/llvm/llvm-project/blob/ff153bd553574e8049fb1f4d6858c889bc2e99a8/llvm/lib/CodeGen/MachineFunction.cpp#L164-L166
https://github.com/llvm/llvm-project/pull/88610
More information about the llvm-commits
mailing list