Skip to content

Commit e423058

Browse files
committedMar 26, 2021
Auto merge of #82980 - tmiasko:import-cold-multiplier, r=michaelwoerister
Import small cold functions The Rust code is often written under an assumption that for generic methods inline attribute is mostly unnecessary, since for optimized builds using ThinLTO, a method will be code generated in at least one CGU and available for import. For example, deref implementations for Box, Vec, MutexGuard, and MutexGuard are not currently marked as inline, neither is identity implementation of From trait. In PGO builds, when functions are determined to be cold, the default multiplier of zero will stop the import, no matter how trivial the implementation. Increase slightly the default multiplier from 0 to 0.1. r? `@ghost`
2 parents 4137088 + 1aee808 commit e423058

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎compiler/rustc_codegen_llvm/src/llvm_util.rs

+3
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ unsafe fn configure_llvm(sess: &Session) {
9898
// during inlining. Unfortunately these may block other optimizations.
9999
add("-preserve-alignment-assumptions-during-inlining=false", false);
100100

101+
// Use non-zero `import-instr-limit` multiplier for cold callsites.
102+
add("-import-cold-multiplier=0.1", false);
103+
101104
for arg in sess_args {
102105
add(&(*arg), true);
103106
}

0 commit comments

Comments
 (0)
Please sign in to comment.