[llvm] [WPD] Reduce ThinLTO link time by avoiding unnecessary summary analysis (PR #164046)

Mingming Liu via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 22 12:16:59 PDT 2025


================
@@ -1142,6 +1142,11 @@ bool DevirtIndex::tryFindVirtualCallTargets(
         if (LocalFound)
           return false;
         LocalFound = true;
+      } else {
+        // Don't expect to find a mix of locals and non-locals (due to path
+        // prefix for locals one should never have the same GUID as a
+        // non-local).
+        assert(!LocalFound);
----------------
mingmingl-llvm wrote:

Sounds good. 

If I understand the series of reworked optimization correctly, the idea is to skip loop iteration selectively when GlobalValueSummaryList bit states shows it's safe to do so. Statistically this optimization applies for many summary lists and LTO indexing will speed up.

https://github.com/llvm/llvm-project/pull/164046


More information about the llvm-commits mailing list