-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.Category: This is a bug.
Description
I tried compiling my crate with RUSTFLAGS="-Z merge-functions=aliases"
, but saw no difference in output size, whereas RUSTFLAGS="-C passes=mergefunc"
showed a 1% improvement (not much but I'd take it). I think this is because of this code:
rust/compiler/rustc_codegen_ssa/src/back/write.rs
Lines 248 to 259 in c3b7d7b
merge_functions: match sess | |
.opts | |
.debugging_opts | |
.merge_functions | |
.unwrap_or(sess.target.merge_functions) | |
{ | |
MergeFunctions::Disabled => false, | |
MergeFunctions::Trampolines | MergeFunctions::Aliases => { | |
sess.opts.optimize == config::OptLevel::Default | |
|| sess.opts.optimize == config::OptLevel::Aggressive | |
} | |
}, |
which is probably intended to exclude opt-level=0 builds but should really at least allow Size (s) and SizeMin (z), if not enable them by default.
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.Category: This is a bug.