[PATCH] D19351: ELF: Add initial ThinLTO support.

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Thu May 12 16:32:47 PDT 2016


On 12 May 2016 at 16:13, Peter Collingbourne <peter at pcc.me.uk> wrote:
> pcc added a comment.
>
> I have updated the patch. I just want to make sure that people are happy with the situation around the ThinLTO API. I've been working on an LTO/ThinLTO API that could be used by both the gold plugin and lld which should address Mehdi's concerns, but it will take some time until that's ready.
>

Sorry I dropped out of this thread.

I don't known a lot about ThinLTO, so most comments will be generic about LTO.

The way the existing lib/LTO is implemented is fundamentally different
from what we do in the gold plugin or lld. We want to make sure we
don't even read and copy symbols if the linker decided to not keep it.
The lib/LTO interface is designed to talk about symbols in the merged
module.

Having said that, I dislike duplicated code as much as anyone else.
That is why I really don't want lld calling into Linker::linkModules:
it duplicates symbol resolution. The same goes for the call to
addPassesToEmitFile. We really should figure out a single place to
populate the pipeline.

If it is possible for lld/gold/LTO to share more code, excellent but:

* I would probably not put that in lib/LTO. Lets keep that just for
the existing api.
* It still seems a bit early for this. We still having more basic
things to finish in lld and the thinLTO api is still moving.

Cheers,
Rafael


More information about the llvm-commits mailing list