[PATCH] D147584: [lld] Support separate minimized bitcode file path in --thinlto-prefix-replace

Ivan Tadeu Ferreira Antunes Filho via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 4 17:00:36 PDT 2023


itf created this revision.
itf added reviewers: tejohnson, MaskRay.
itf added projects: lld, lld-macho, LLVM.
Herald added subscribers: ormris, steven_wu, hiraditya, arichardson, inglorion, emaste.
Herald added a reviewer: lld-macho.
Herald added a project: All.
itf requested review of this revision.
Herald added a subscriber: llvm-commits.

Currently, the --thinlto-suffix-replace="oldsuffix;newsuffix" option 
is used during distributed ThinLTO thin links to specify the mapping 
of the input bitcode object file to the minimized bitcode file. 
--thinlto-suffix-replace is the only option specifying the mapping
between those files.

This forces the full bitcode file and the minimized bitcode file to be in
the same directory.

This patch expands the --thinlto-prefix-replace option to allow a separate directory
tree mapping to be specified for the minimized bitcode file paths.

This is important to support builds and build systems where a directory 
that is the output of a single action must either be fully included or
not included as the input of another action (e.g. the thin link, it must take as its input
the minimized bitcode files but not take as input the full bitcode files).

The new format is: --thinlto-prefix-replace="origpath;outpath[;objpath][;minimizedbitcodepath]"

If minimizedbitcodepath is specified it replaces minimizedbitcodepath of the minimized bitcode files with
origpath when mapping the minimized bitcode to the full bitcode, otherwise it falls back to the old behavior 
of assuming both files are in the same directory.

With this change, --thinlto-suffix-replace can now be deprecated. Instead of mapping
the minimized bitcode to the full bitcode using a suffix replace, we can instead use
a prefix replace.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147584

Files:
  lld/COFF/Config.h
  lld/COFF/Driver.cpp
  lld/COFF/InputFiles.cpp
  lld/ELF/Config.h
  lld/ELF/Driver.cpp
  lld/ELF/InputFiles.cpp
  lld/MachO/Config.h
  lld/MachO/Driver.cpp
  lld/MachO/InputFiles.cpp
  lld/test/COFF/thinlto-minimized-bitcode-prefix-replace.ll
  lld/test/ELF/lto/thinlto-minimized-bitcode-prefix-replace.ll
  lld/test/MachO/thinlto-minimized-bitcode-prefix-replace.ll
  llvm/tools/gold/gold-plugin.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147584.510963.patch
Type: text/x-patch
Size: 16312 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230405/a0a644e0/attachment.bin>


More information about the llvm-commits mailing list