[PATCH] D18343: ThinLTO: use the callgraph from the combined index to drive the FunctionImporter

David Li via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 25 10:29:07 PDT 2016


davidxl added a subscriber: davidxl.

================
Comment at: lib/Transforms/IPO/FunctionImport.cpp:70
@@ +69,3 @@
+/// FIXME: select "best" instead of first that fits. But what is "best"? The
+/// smallest? The one with the least edges? A mix?
+static const FunctionSummary *
----------------
tejohnson wrote:
> - Prioritize copies from a module already being imported from (reduces # source modules parsed/linked)
> - Prioritize any that has profile data, although we don't have that info here (not sure how COMDAT profile matching works on llvm, I know on gcc only the selected or any inlined/selected copies would get profile data, may be different on llvm due to single profile database?)
In LLVM, comdat function's profile counters will also be put into comdat, so there should be no need to differentiate based on profile availability.

================
Comment at: lib/Transforms/IPO/FunctionImport.cpp:95
@@ +94,3 @@
+/// null if there's no match.
+static const FunctionSummary *selectCallee(uint64_t GUID, unsigned Threshold,
+                                           const ModuleSummaryIndex &Index) {
----------------
Why not passing a reference of the Edge to 'selectCallee'. We will need to look at profile data in the future.


http://reviews.llvm.org/D18343





More information about the llvm-commits mailing list