[PATCH] D88041: [lld] Add a flag to enable split machine functions for LTO.

Snehasish Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 15:42:28 PDT 2020


snehasish added a subscriber: mtrofin.
snehasish added a comment.

In D88041#2287900 <https://reviews.llvm.org/D88041#2287900>, @tejohnson wrote:

> Is it expected that the user will want to specify this only at link time and not during compile time? If it is normally specified in the compile step, you should consider adding it to the IR in some fashion (e.g. function attributes). The advantage is that the user doesn't need to pass different options for the LTO and non-LTO cases.

Ideally we should only have to specify this once. However, using function attributes doesn't seem ideal since the pass will be scheduled and repeatedly invoked only to return without actually running the pass. It would be cleaner to marshal the codegen specific options from the compile invocation and restore them for the LTO step. There are a couple of other codegen options which would also benefit from this approach `--lto-unique-basic-block-section-names`, `--lto-basic-block-sections=<value>`. @mtrofin pointed out that -fembed-bitcode saves the invocation in `.llvmcmd`. A similar approach to stash codegen specific options always for LTO to pick up and enable might be less intrusive. However, this is a larger effort and for current LTO builds it would be nice to have a command line option to enable it. WDYT about this alternative?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88041



More information about the llvm-commits mailing list