Skip to content

Commit e454644

Browse files
committed
Auto merge of #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 5257aee + 4ebb694 commit e454644

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

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

+9-2
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,18 @@ pub fn bolt_optimize(path: &Utf8Path, profile: &BoltProfile) -> anyhow::Result<(
6666
// Split function code into hot and code regions
6767
.arg("-split-functions")
6868
// Split as many basic blocks as possible
69-
.arg("-split-all-cold")
70-
// Move jump tables to a separate section
7169
.arg("-jump-tables=move")
7270
// Fold functions with identical code
7371
.arg("-icf=1")
72+
// Perform indirect call promotion on calls and jump tables
73+
.arg("-indirect-call-promotion=all")
74+
// Optimize stack frame accesses
75+
.arg("-frame-opt=hot")
76+
// Inline functions smaller than 32 bytes
77+
.arg("-inline-small-functions")
78+
.arg("-inline-small-functions-bytes=32")
79+
// Perform peephole optimizations
80+
.arg("-peepholes=all")
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)