[PATCH] D11907: LLVM support for -fthinlto option, and gold support for thinlto plugin option.

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 14:06:56 PDT 2015


tejohnson added inline comments.

================
Comment at: tools/gold/gold-plugin.cpp:132
@@ -127,1 +131,3 @@
       TheOutputType = OT_DISABLE;
+    } else if (opt == "thinlto") {
+      thinlto = true;
----------------
pcc wrote:
> Do we need a new plugin option? Would it not be possible to determine whether ThinLTO is needed by reading the intermediate files?
> Thanks for the suggestion. Yes, we could do that. It does mean (for the bitcode representation I proposed last week) that the MODULE_BLOCK would first need to be scanned for a THINLTO_BLOCK nested directly within it. I.e. each of the top level blocks and records nested directly within the module block need to be skipped through. So a bit more compile time. I'm not sure how much this matters in practice though.

I experimented with a large source file (>400K loc, >51K functions), and measured how long it took to skip all blocks/records and just check whether it contained a thinlto block. It was negligible (~0.1s), so I think this is the way to go. I will update the patch to remove the change to gold-plugin.cpp and the change to pass in the new plugin option.


http://reviews.llvm.org/D11907





More information about the llvm-commits mailing list