diff options
| author | Erik Desjardins <erikdesjardins@users.noreply.github.com> | 2021-12-29 15:28:31 -0500 |
|---|---|---|
| committer | Erik Desjardins <erikdesjardins@users.noreply.github.com> | 2021-12-29 15:47:49 -0500 |
| commit | 2b662217e745d88d93dcc6f5f5169bf7a0d9720e (patch) | |
| tree | 0e471ecb5e4a57ae2f5f3aa70fdfe5895cf99e91 /compiler/rustc_codegen_ssa/src | |
| parent | 7ae550842635dce84811198446fe87e830de500b (diff) | |
Mark drop calls in landing pads cold instead of noinline
Now that deferred inlining has been disabled in LLVM, this shouldn't cause catastrophic size blowup.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/mir/block.rs | 7 | ||||
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/traits/builder.rs | 2 |
2 files changed, 3 insertions, 6 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/block.rs b/compiler/rustc_codegen_ssa/src/mir/block.rs index e914e493269..8cefd415e28 100644 --- a/compiler/rustc_codegen_ssa/src/mir/block.rs +++ b/compiler/rustc_codegen_ssa/src/mir/block.rs @@ -160,11 +160,8 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> { let llret = bx.call(fn_ty, fn_ptr, &llargs, self.funclet(fx)); bx.apply_attrs_callsite(&fn_abi, llret); if fx.mir[self.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. - bx.do_not_inline(llret); + // Cleanup is always the cold path. + bx.mark_callsite_cold(llret); } if let Some((ret_dest, target)) = destination { diff --git a/compiler/rustc_codegen_ssa/src/traits/builder.rs b/compiler/rustc_codegen_ssa/src/traits/builder.rs index 158e658301e..c1cdff3adda 100644 --- a/compiler/rustc_codegen_ssa/src/traits/builder.rs +++ b/compiler/rustc_codegen_ssa/src/traits/builder.rs @@ -311,5 +311,5 @@ pub trait BuilderMethods<'a, 'tcx>: ) -> Self::Value; fn zext(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value; - fn do_not_inline(&mut self, llret: Self::Value); + fn mark_callsite_cold(&mut self, llret: Self::Value); } |
