[PATCH] D27324: IPO: Introduce ThinLTOBitcodeWriter pass.

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 2 10:19:18 PST 2016


tejohnson added a comment.

Just skimmed the code so far, and have a high-level question. Why a new pass instead of building this into the existing WriteBitcodePass as an option? It's confusing because that pass also has the ability to write bitcode for ThinLTO. Is the intention to use this new pass instead of WriteBitcodePass when we are building with -flto=thin (i.e. from clang)? Seems cleaner to use a single pass and not have clang worry about which to invoke. Also avoids redundancy in the ThinLTO handling.



================
Comment at: llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp:201
+  // FIXME: Try to re-use BSI and PFI from the original module here.
+  ModuleSummaryIndex Index = buildModuleSummaryIndex(*ThinM, nullptr, nullptr);
+  W.writeModule(ThinM.get(), /*ShouldPreserveUseListOrder=*/false, &Index,
----------------
The WriteBitcodePass instead uses the ModuleSummaryIndexAnalysis pass to construct the index. This pass should be consistent with that.


https://reviews.llvm.org/D27324





More information about the llvm-commits mailing list