about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJakub Beránek <berykubik@gmail.com>2023-08-09 09:31:22 +0200
committerJakub Beránek <berykubik@gmail.com>2023-08-09 09:33:42 +0200
commit6b4ec09cab1f72a17285285c356acc0afdcd47e6 (patch)
tree7df7d11f1d50376618dd600dc32a0dd375dc556e
parent8838c73e866aa85b40463640ff6f5af268507812 (diff)
downloadrust-6b4ec09cab1f72a17285285c356acc0afdcd47e6.tar.gz
rust-6b4ec09cab1f72a17285285c356acc0afdcd47e6.zip
Remove usage of `--use-old-text` for BOLT
-rw-r--r--src/tools/opt-dist/src/bolt.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tools/opt-dist/src/bolt.rs b/src/tools/opt-dist/src/bolt.rs
index e44b8a4db92..cf9f4fabcec 100644
--- a/src/tools/opt-dist/src/bolt.rs
+++ b/src/tools/opt-dist/src/bolt.rs
@@ -65,8 +65,13 @@ pub fn bolt_optimize(path: &Utf8Path, profile: &LlvmBoltProfile) -> anyhow::Resu
         .arg("-jump-tables=move")
         // Fold functions with identical code
         .arg("-icf=1")
+        // The following flag saves about 50 MiB of libLLVM.so size.
+        // However, it succeeds very non-deterministically. To avoid frequent artifact size swings,
+        // it is kept disabled for now.
+        // FIXME(kobzol): try to re-enable this once BOLT in-place rewriting is merged or after
+        // we bump LLVM.
         // Try to reuse old text segments to reduce binary size
-        .arg("--use-old-text")
+        // .arg("--use-old-text")
         // Update DWARF debug info in the final binary
         .arg("-update-debug-sections")
         // Print optimization statistics