[PATCH] D34156: [LTO] Add -femit-summary-index flag to emit summary for regular LTO

Peter Collingbourne via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 13 12:12:37 PDT 2017

pcc added a comment.

Have you considered writing the regular LTO summaries unconditionally if `-flto` was specified? That was how I imagined that the interface would look.

Also, how were you planning to expose the reference graph to the linker? I gather from your message that you are teaching your linker to read the module summary index directly from bitcode files. I wonder whether it would be worth trying to avoid needing to read summaries multiple times. The approach that I had in mind was to somehow teach the linker to add regular object files to the combined summary index by creating a "global value summary" for each section, with a reference for each relocation. (This would be similar to how we add regular LTO inputs to the combined summary in https://reviews.llvm.org/D33922.) Then LTO would run as usual. Any regular object sections would then naturally participate in the summary-based dead stripping that LTO already does.


More information about the cfe-commits mailing list