about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-08-09 10:41:15 +0000
committerbors <bors@rust-lang.org>2023-08-09 10:41:15 +0000
commitd190d978649a9bee690ab7d489b59e4c3a78dee4 (patch)
treefaa632ee038c8a35651603a3703344f95ed73fd7
parent19a647d6d8f6ead984d7b431c4a8376e02c543e6 (diff)
parent6b4ec09cab1f72a17285285c356acc0afdcd47e6 (diff)
downloadrust-d190d978649a9bee690ab7d489b59e4c3a78dee4.tar.gz
rust-d190d978649a9bee690ab7d489b59e4c3a78dee4.zip
Auto merge of #114649 - Kobzol:bolt-remove-use-old-text, r=nikic
Remove usage of `--use-old-text` for BOLT

This flag has [reduced](https://github.com/rust-lang/rust/pull/114141) the size of `libLLVM.so` by ~50 MiB, but sadly it is quite non-deterministic and the size savings frequently fail, thus causing large artifact size [swings](https://github.com/rust-lang/rust/pull/114297#issuecomment-1670292387). To avoid the swings, it would be better to just disable the flag for now.

r? `@nikic`
-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