Ben Dunbobbin 11b439c5c5
[DTLTO] Speed up temporary file removal in the ThinLTO backend (#186988)
Deleting the temporary files produced by the DTLTO ThinLTO backend can
be expensive on Windows hosts. For a Clang link (Debug build with
sanitizers and instrumentation) using an optimized toolchain (PGO
non-LTO, llvmorg-22.1.0) on a Windows 11 Pro (Build 26200), AMD Family
25 @ ~4.5 GHz, 16 cores / 32 threads, 64 GB RAM machine, the mean
duration of the "Remove DTLTO temporary files" time trace scope was
1267.789 ms (measured over 10 runs).

This patch performs the deletions on a background thread, allowing them
to overlap with the remainder of the link to hide this cost.

Based on work by @romanova-ekaterina and @kbelochapka.
2026-03-19 20:08:23 +00:00
..