about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-04-11 17:00:31 +0000
committerbors <bors@rust-lang.org>2025-04-11 17:00:31 +0000
commited3a4aac8172c599c181120bddd2840843ecc9ad (patch)
tree35a286f685c957684c6b6591404986d4ed68624e /src/bootstrap
parente1b06f773063140263558b858cb6e4c99755a763 (diff)
parent9a26863acc2a8fdd6a21834fa418673ee33861e2 (diff)
downloadrust-ed3a4aac8172c599c181120bddd2840843ecc9ad.tar.gz
rust-ed3a4aac8172c599c181120bddd2840843ecc9ad.zip
Auto merge of #139588 - Kobzol:rust-analyzer-opt, r=jieyouxu
Use LTO to optimize Rust tools (cargo, miri, rustfmt, clippy, Rust Analyzer)

Trying if LTO/PGO can help RA's performance, and by how much. As `@Noratrieb` suggested, we could actually LTO optimize all the important tools.

CC `@Veykril` I realized that we don't even do LTO for Rust Analyzer, that could be a very low hanging fruit to improve its performance :sweat_smile:

try-job: dist-x86_64-linux
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/src/core/build_steps/tool.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs
index 7cc7093e23b..1c61f0a56d7 100644
--- a/src/bootstrap/src/core/build_steps/tool.rs
+++ b/src/bootstrap/src/core/build_steps/tool.rs
@@ -148,7 +148,9 @@ impl Step for ToolBuild {
             &self.extra_features,
         );
 
-        if path.ends_with("/rustdoc") &&
+        // Rustc tools (miri, clippy, cargo, rustfmt, rust-analyzer)
+        // could use the additional optimizations.
+        if self.mode == Mode::ToolRustc &&
             // rustdoc is performance sensitive, so apply LTO to it.
             is_lto_stage(&self.compiler)
         {