Skip to content

Commit

Permalink
Auto merge of rust-lang#114649 - Kobzol:bolt-remove-use-old-text, r=n…
Browse files Browse the repository at this point in the history
…ikic

Remove usage of `--use-old-text` for BOLT

This flag has [reduced](rust-lang#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](rust-lang#114297 (comment)). To avoid the swings, it would be better to just disable the flag for now.

r? `@nikic`
  • Loading branch information
bors committed Aug 9, 2023
2 parents 19a647d + 6b4ec09 commit d190d97
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/tools/opt-dist/src/bolt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d190d97

Please sign in to comment.