[PATCH] D68950: [ThinLTOCodeGenerator] Add support for index-based WPD

Steven Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 14 13:15:51 PDT 2019


steven_wu added a comment.

Thanks for working on this. Comments inline.



================
Comment at: lib/LTO/ThinLTOCodeGenerator.cpp:583
 
-static void internalizeAndPromoteInIndex(
-    const StringMap<FunctionImporter::ExportSetTy> &ExportLists,
-    const DenseSet<GlobalValue::GUID> &GUIDPreservedSymbols,
-    const DenseMap<GlobalValue::GUID, const GlobalValueSummary *>
-        &PrevailingCopy,
-    ModuleSummaryIndex &Index) {
-  auto isExported = [&](StringRef ModuleIdentifier, GlobalValue::GUID GUID) {
+struct IsExported {
+  const StringMap<FunctionImporter::ExportSetTy> &ExportLists;
----------------
I know this struct is callable but `IsExported` feels like a weird name for stuck. Maybe something like `ExportedSymbolChecker`?

Same for `IsPrevailing`.


================
Comment at: lib/LTO/ThinLTOCodeGenerator.cpp:849
   // Optimize now
-  optimizeModule(TheModule, *TMBuilder.create(), OptLevel, Freestanding);
+  optimizeModule(TheModule, *TMBuilder.create(), OptLevel, Freestanding,
+                 nullptr);
----------------
Should we add indexed-based WPD into optimized as well? So we can add a unit test using `optimize`, rather than `run`. You can add a flag to `llvm-lto` to determine if WPD is enabled.


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

https://reviews.llvm.org/D68950





More information about the llvm-commits mailing list