Skip to content

Commit 63c330d

Browse files
committed
[CodeGen][NPM] Parse MachineFunctions in NPM driver
1 parent dc326d0 commit 63c330d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm/tools/llc/NewPMDriver.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,12 @@ int llvm::compileModuleWithNewPM(
153153
FPM.addPass(createFunctionToMachineFunctionPassAdaptor(std::move(MFPM)));
154154
MPM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
155155

156-
if (MIR->parseMachineFunctions(*M, MAM))
157-
return 1;
158156
} else {
159157
ExitOnErr(Target->buildCodeGenPipeline(
160158
MPM, *OS, DwoOut ? &DwoOut->os() : nullptr, FileType, Opt, &PIC));
161159
}
162160

161+
// If user only wants to print the pipeline, print it before parsing the MIR.
163162
if (PrintPipelinePasses) {
164163
std::string PipelineStr;
165164
raw_string_ostream OS(PipelineStr);
@@ -171,6 +170,9 @@ int llvm::compileModuleWithNewPM(
171170
return 0;
172171
}
173172

173+
if (MIR->parseMachineFunctions(*M, MAM))
174+
return 1;
175+
174176
// Before executing passes, print the final values of the LLVM options.
175177
cl::PrintOptionValues();
176178

0 commit comments

Comments
 (0)