[PATCH] D60421: [ThinLTO] Fix ThinLTOCodegenerator to export llvm.used symbols

Steven Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 10 08:59:08 PDT 2019


steven_wu added a comment.

In D60421#1461407 <https://reviews.llvm.org/D60421#1461407>, @bd1976llvm wrote:

> Hi Steven,
>
> I missed that this work was being done - sorry.
>
> Currently the legacy api does not require the IRSymtab to be written to the bitcode files so there is potentially a performance degradation due to this approach and the generated bitcode files will be larger, did you measure that?


The legacy API is not writing out IRSymtab but build that in memory during code generation. The only requirement change is that now data layout is required for thin LTO .

> There is also a hidden performance cost that if the bitcode needs upgrading then the IRSymtab must be regenerated which can be expensive.

I did a simple performance test in https://reviews.llvm.org/D60226. Yes, the cost of hitting the upgrade path is quite significant (50% thin link time increase) but not measurable if no upgrade is hit. I don’t have big concerns over this. Let me know if you think it is harmful.

> An alternative approach is for the legacy api to get the list of used symbols from the bitcode and expose them via the lto_symbol_attributes; the system linker can then add "used" symbols to the preserve list directly. This seems more in-keeping with the original design IMO.

That was one of the proposals I had but some change needs to made to encode and convey this info. See previous review for more info.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60421





More information about the llvm-commits mailing list