[PATCH] D46034: Support for distributed ThinLTO options

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 25 13:52:53 PDT 2018


tejohnson added inline comments.


================
Comment at: lld/ELF/Driver.cpp:1015
+      // With ThinLTOIndexOnly option, Thinlto needs to generate object files
+      // for all bitcode files(even with no symbols). After index files are
+      // created, we exit from linker and LTO Distributed Backend runs. This
----------------
pcc wrote:
> The problem as I understand it is not related to files with no symbols but rather that if an object file between `--start-lib` and `--end-lib` is not selected using the usual rules for adding archive members to the link, the distributed build system will still want to see a `.thinlto.bc` file for it, even if it is unused.
There are two cases where we may need to write out an empty file:
1) object between --start-lib and --end-lib is not selected by the link
2) The case handled by https://reviews.llvm.org/D42514, when the object is skipped by ThinLTO because it doesn't have a summary, which I think is due to side effects of module splitting for types?

It's also not so much that we need to generate object files, this step is not generating object files in a distributed build, but rather that we are expected to generate the necessary index files. It's this indexing step (the thin link) of the distributed build system that wants to validate that all the expected output files have been created.

Perhaps the comment can then be changed to something along the lines of "With the ThinLTOIndexOnly option, only the thin link is performed, and will generate index files for the ThinLTO backends in a distributed build system. The distributed build system may expect that index files are created for all input bitcode objects provided to the linker for the thin link. However, index files will not normally be created for input bitcode objects that either aren't selected by the linker (i.e. in a static library and not needed), or because they don't have a summary. Therefore we need to create empty dummy index file outputs in those cases".


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D46034





More information about the llvm-commits mailing list