Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mark calls in the unwind path as !noinline #42771

Merged
merged 1 commit into from
Jun 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/librustc_trans/mir/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ impl<'a, 'tcx> MirContext<'a, 'tcx> {
} 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 {
Expand Down
2 changes: 0 additions & 2 deletions src/test/run-pass/issue-41696.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]

Expand Down