[llvm-dev] New Pass Manager with flto[=thin] not enabled (??)

Graham Yiu via llvm-dev llvm-dev at lists.llvm.org
Tue Oct 3 11:57:20 PDT 2017



Hello,

I recently noticed that the new pass manager was not enabled at
regular/thin LTO link step even if '-fexperimental-new-pass-manager' was
specified in the compile step and link step commands.  Upon closer
inspection, it seems there's so real way to invoke the new pass manager
path ('runNewPMPasses' in lib/LTO/LTOBackend.cpp) during link step.

'Conf.UseNewPM' is used to select the new PM in LTOBackend.cpp, but only
two places in the code sets it.  The first is through the 'llvm-lto2' tool,
and the second during the compile step with '-fthinlto-index=<value>'.
Neither are invoked during LTO/thinLTO link.

tools/llvm-lto2/llvm-lto2.cpp
...
static cl::opt<bool>
    UseNewPM("use-new-pm",
             cl::desc("Run LTO passes using the new pass manager"),
             cl::init(false), cl::Hidden);
...
  Conf.UseNewPM = UseNewPM;
...

projects/clang/lib/CodeGen/BackendUtil.cpp
...
void clang::EmitBackendOutput( (...) {
...
      runThinLTOBackend(CombinedIndex.get(), M, HeaderOpts, CGOpts, TOpts,
                        LOpts, std::move(OS), CGOpts.SampleProfileFile,
Action);
      return;
...
}

static void runThinLTOBackend (...) {
...
  Conf.UseNewPM = CGOpts.ExperimentalNewPassManager;
...
}

My team and I were wondering if this is:
      intentional,
      if so, why do we not have an option to enable the new PM in the link
      step
      if not, should we pass an option via '-plugin-opt', or via some other
      mechanism?  It's unclear to me what the preferred method of passing
      configuration options to LTO/thinLTO link step is.

Any insights/thoughts/comments would be greatly appreciated.

Cheers,

Graham Yiu
LLVM Compiler Development
IBM Toronto Software Lab
Office: (905) 413-4077      C2-707/8200/Markham
Email: gyiu at ca.ibm.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171003/4c253cf7/attachment.html>


More information about the llvm-dev mailing list