Mark extern rust-cold calls as cold
This commit is contained in:
parent
875ffa19b1
commit
a298c6908e
@ -376,9 +376,15 @@ pub(crate) fn codegen_terminator_call<'tcx>(
|
|||||||
RevealAllLayoutCx(fx.tcx).fn_abi_of_fn_ptr(fn_ty.fn_sig(fx.tcx), extra_args)
|
RevealAllLayoutCx(fx.tcx).fn_abi_of_fn_ptr(fn_ty.fn_sig(fx.tcx), extra_args)
|
||||||
};
|
};
|
||||||
|
|
||||||
let is_cold = instance
|
let is_cold = if fn_sig.abi == Abi::RustCold {
|
||||||
.map(|inst| fx.tcx.codegen_fn_attrs(inst.def_id()).flags.contains(CodegenFnAttrFlags::COLD))
|
true
|
||||||
.unwrap_or(false);
|
} else {
|
||||||
|
instance
|
||||||
|
.map(|inst| {
|
||||||
|
fx.tcx.codegen_fn_attrs(inst.def_id()).flags.contains(CodegenFnAttrFlags::COLD)
|
||||||
|
})
|
||||||
|
.unwrap_or(false)
|
||||||
|
};
|
||||||
if is_cold {
|
if is_cold {
|
||||||
fx.bcx.set_cold_block(fx.bcx.current_block().unwrap());
|
fx.bcx.set_cold_block(fx.bcx.current_block().unwrap());
|
||||||
if let Some(destination_block) = target {
|
if let Some(destination_block) = target {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user