[PATCH] D23488: ThinLTO: add early "dead-stripping" on the Index

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 22 09:01:44 PDT 2016


mehdi_amini added inline comments.

================
Comment at: include/llvm/Transforms/IPO/FunctionImport.h:98
@@ -95,1 +97,3 @@
+    StringMap<FunctionImporter::ExportSetTy> &ExportLists,
+    const DenseSet<GlobalValue::GUID> *DeadSymbols = nullptr);
 
----------------
I tried moved the computation to `ComputeCrossModuleImport`. But if you look at LTO.cpp `runThinLTO()` we reuse the `DeadSymbols` set for the lambda `isExported` used as a callback for `thinLTOInternalizeAndPromoteInIndex`

================
Comment at: lib/LTO/ThinLTOCodeGenerator.cpp:529
@@ +528,3 @@
+  // Compute "dead" symbols, we don't want to import/export these!
+  auto DeadSymbols = computeDeadSymbols(Index, GUIDPreservedSymbols);
+
----------------
The move to the new API should fix it!

================
Comment at: lib/Transforms/IPO/FunctionImport.cpp:467
@@ +466,3 @@
+
+    // FIXME: we should only make the prevailing copy live here
+    for (auto &Summary : It->second) {
----------------
I tried to do it, but figure it'll be easy after the ThinLTOCodeGenerator is moved the new API, so I don't have multiple call sites to convert to pass a lambda, so I'll leave it for a future patch :)

================
Comment at: lib/Transforms/IPO/FunctionImport.cpp:473
@@ +472,3 @@
+          DEBUG(dbgs() << "Marking live (ref): " << (uint64_t)RefGUID << " "
+                       << (int64_t)RefGUID << "\n");
+          Worklist.push_back(RefGUID);
----------------
That was just debugging.


https://reviews.llvm.org/D23488





More information about the llvm-commits mailing list