Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit e1d8daa

Browse files
committed
Auto merge of rust-lang#121902 - blyxyas:better-opt, r=<try>
Add more BOLT optimizations This PR adds some more BOLT flags. I'm not sure why they were not added on the first place. I sadly cannot benchmark the changes on my machines (I'm having some problems). To not expand the build time too much, I only added the most influential on final times (inlining small functions and peepholes being the most influential). As this is just a experiment, let's not assign anyone yet. Let's hope that this one PR improves runtimes. Improving performance is hard :/ r? ghost
2 parents 7606c13 + e67a236 commit e1d8daa

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/tools/opt-dist/src/bolt.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ pub fn bolt_optimize(path: &Utf8Path, profile: &BoltProfile) -> anyhow::Result<(
7171
.arg("-jump-tables=move")
7272
// Fold functions with identical code
7373
.arg("-icf=1")
74+
// Perform indirect call promotion on calls and jump tables
75+
.arg("-indirect-call-promotion=all")
76+
// Optimize stack frame accesses
77+
.arg("-frame-opt=hot")
78+
// Inline functions smaller than 32 bytes
79+
.arg("-inline-small-functions")
80+
.arg("-inline-small-functions-bytes=32")
7481
// The following flag saves about 50 MiB of libLLVM.so size.
7582
// However, it succeeds very non-deterministically. To avoid frequent artifact size swings,
7683
// it is kept disabled for now.

0 commit comments

Comments
 (0)