[CodeGen][NPM] Parse MachineFunctions in NPM driver (#128467)

MachineFunctions were not being parsed when target is allowed to build
the pipeline.

This will allow us to use `-start-before` and other options.
This commit is contained in:
Akshat Oke
2025-03-20 12:21:43 +05:30
committed by GitHub
parent 9cdbc47144
commit 4254f2777c

View File

@@ -153,13 +153,12 @@ int llvm::compileModuleWithNewPM(
FPM.addPass(createFunctionToMachineFunctionPassAdaptor(std::move(MFPM)));
MPM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
if (MIR->parseMachineFunctions(*M, MAM))
return 1;
} else {
ExitOnErr(Target->buildCodeGenPipeline(
MPM, *OS, DwoOut ? &DwoOut->os() : nullptr, FileType, Opt, &PIC));
}
// If user only wants to print the pipeline, print it before parsing the MIR.
if (PrintPipelinePasses) {
std::string PipelineStr;
raw_string_ostream OS(PipelineStr);
@@ -171,6 +170,9 @@ int llvm::compileModuleWithNewPM(
return 0;
}
if (MIR && MIR->parseMachineFunctions(*M, MAM))
return 1;
// Before executing passes, print the final values of the LLVM options.
cl::PrintOptionValues();