[PATCH] D46034: Support for distributed ThinLTO options

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 25 14:20:49 PDT 2018


pcc added inline comments.


================
Comment at: lld/ELF/Driver.cpp:1018
+      // distributed build system will want to confirm that all expected outputs
+      // are created based on all of the modules provided to the linker.
+      if (Config->ThinLTOIndexOnly)
----------------
rdhindsa wrote:
> pcc wrote:
> > This part seems to be equivalent to `writeEmptyDistributedBuildOutputs` in the gold plugin. It's unfortunate that we need this in order to work around a deficiency in the distributed build system, but if we are going to do this, can we instead do something equivalent to that in order to avoid linking more than we need?
> > 
> > I think we should be able to do this by keeping track of which `LazyObjFile`s have been added to the link, and emitting a `.thinlto.bc` file for every file that has not been added to the link.
> I intended to add similar functionality as to writeEmptyDistributedBuildOutputs in the LTO.cpp while trying to add files, so that we emit .thinlto.bc for every file, instead of doing more linking. Will that be okay? 
It depends what you mean by "every file". We can't just do it for files added using `BitcodeCompiler::add` because that wouldn't include non-selected files and then you're back to the original problem.  And we can't do it for everything in `LinkerDriver::Files` because that would include regular object files like `crtbegin.o`. I think that we can do it by filtering `LinkerDriver::Files` along the lines that I mentioned.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D46034





More information about the llvm-commits mailing list