1
Fork 0

Revert "Auto merge of #92419 - erikdesjardins:coldland, r=nagisa"

This reverts commit 4f49627c6f, reversing
changes made to 028c6f1454.
This commit is contained in:
Erik Desjardins 2022-02-26 12:52:07 -05:00
parent 3b1fe7e7c9
commit 851fcc7a54
9 changed files with 12 additions and 87 deletions

View file

@ -166,7 +166,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
bx.invoke(fn_ty, fn_ptr, &llargs, ret_llbb, unwind_block, self.funclet(fx));
bx.apply_attrs_callsite(&fn_abi, invokeret);
if fx.mir[self.bb].is_cleanup {
bx.apply_attrs_to_cleanup_callsite(invokeret);
bx.do_not_inline(invokeret);
}
if let Some((ret_dest, target)) = destination {
@ -178,7 +178,11 @@ 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 {
bx.apply_attrs_to_cleanup_callsite(llret);
// 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);
}
if let Some((ret_dest, target)) = destination {
@ -1444,7 +1448,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
let llret = bx.call(fn_ty, fn_ptr, &[], None);
bx.apply_attrs_callsite(&fn_abi, llret);
bx.apply_attrs_to_cleanup_callsite(llret);
bx.do_not_inline(llret);
bx.unreachable();

View file

@ -479,5 +479,5 @@ pub trait BuilderMethods<'a, 'tcx>:
) -> Self::Value;
fn zext(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value;
fn apply_attrs_to_cleanup_callsite(&mut self, llret: Self::Value);
fn do_not_inline(&mut self, llret: Self::Value);
}