From 6b4ec09cab1f72a17285285c356acc0afdcd47e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Wed, 9 Aug 2023 09:31:22 +0200 Subject: [PATCH] Remove usage of `--use-old-text` for BOLT --- src/tools/opt-dist/src/bolt.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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