mirror of
https://github.com/rust-lang/rust
synced 2024-09-05 16:57:03 +00:00
Auto merge of #42771 - arielb1:no-inline-unwind, r=nagisa
mark calls in the unwind path as !noinline The unwind path is always cold, so that should not have bad performance implications. This avoids catastrophic exponential inlining, and also decreases the size of librustc.so by 1.5% (OTOH, the size of `libstd.so` increased by 0.5% for some reason). Fixes #41696. r? @nagisa
This commit is contained in:
commit
6de26f42de
|
@ -146,6 +146,13 @@ fn trans_terminator(&mut self,
|
|||
} else {
|
||||
let llret = bcx.call(fn_ptr, &llargs, cleanup_bundle);
|
||||
fn_ty.apply_attrs_callsite(llret);
|
||||
if this.mir[bb].is_cleanup {
|
||||
// Cleanup is always the cold path. Don't inline
|
||||
// drop glue. Also, when there is a deeply-nested
|
||||
// struct, there are "symmetry" issues that cause
|
||||
// exponential inlining - see issue #41696.
|
||||
llvm::Attribute::NoInline.apply_callsite(llvm::AttributePlace::Function, llret);
|
||||
}
|
||||
|
||||
if let Some((ret_dest, ret_ty, target)) = destination {
|
||||
let op = OperandRef {
|
||||
|
|
|
@ -9,8 +9,6 @@
|
|||
// except according to those terms.
|
||||
|
||||
// this used to cause exponential code-size blowup during LLVM passes.
|
||||
// ignore-test FIXME #41696
|
||||
// min-llvm-version 3.9
|
||||
|
||||
#![feature(test)]
|
||||
|
||||
|
|
Loading…
Reference in a new issue