[PATCH] D64188: [NewPM] Port the MIR Printing pass to new pass manager.

Fedor Sergeev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 30 05:11:45 PDT 2019


fedor.sergeev added a comment.

I'm not familiar with MIR printing usecases, and there are no tests for MIR printer.
Yet if MIR printing pass is to be applied to the Module only then there is no need to make it a MachineFunction pass, just do everything in a single run(Module...) method.

I would expect to see a registration of this pass in PassRegistry.def as a module pass. Perhaps named as print-mir?

Also, this patch should definitely have some dependencies on prior work introducing MachineFunction as IRUnit etc...



================
Comment at: llvm/lib/CodeGen/MIRPrintingPass.cpp:26-30
+  // FIXME: Inefficient. Should only make this adaptor once. Put it in
+  // the class and construct it the first time.
+  return createModuleToFunctionPassAdaptor(
+             createFunctionToMachineFunctionPassAdaptor(*this))
+      .run(M, MAM);
----------------
This looks as something artificial.
If you want to iterate through machine functions and print them there is no need to use pass manager.
Just manually iterate and print.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64188/new/

https://reviews.llvm.org/D64188





More information about the llvm-commits mailing list