[llvm] [DTLTO] Do not serialize inputs that hit in the ThinLTO cache (PR #204104)
Edd Dawson via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 23 02:11:41 PDT 2026
================
@@ -0,0 +1,91 @@
+REQUIRES: ld.lld
+
+# Show that DTLTO input file serialization interacts correctly with the
+# ThinLTO cache.
+#
+# To handle bitcode inputs that are not in individual files on disk, such as
+# members of non-thin archives, DTLTO serializes such input bitcode to a
+# temporary individual file on disk. This serialization should only be
+# performed if the backend compilation is required. A backend compilation is
+# only required if there is a miss in the ThinLTO cache for that module, or a
+# module is imported by a module that has missed in the ThinLTO cache.
+#
+# Test DTLTO input serialization across three cases:
+# 1. None of the backend compilations hit in the ThinLTO cache.
+# 2. All of the backend compilations hit in the ThinLTO cache.
+# 3. Some backend compilations hit in the ThinLTO cache and some miss.
+
+RUN: rm -rf %t && split-file %s %t && cd %t
+
+RUN: %clang --target=x86_64-linux-gnu -O2 -flto=thin -c t1.c t2.c
+RUN: llvm-ar rcs t1.a t1.o
+RUN: llvm-ar rcs t2.a t2.o
----------------
playstation-edd wrote:
I don't think this is an especially big deal, but the choice of "t" in these names makes this look like a possible refactoring remnant (`%t` -> `t`).
https://github.com/llvm/llvm-project/pull/204104
More information about the llvm-commits
mailing list