Mark cold blocks

This commit is contained in:
bjorn3 2022-03-13 15:51:39 +01:00
parent 7eb454124f
commit 90f8aefe71
2 changed files with 5 additions and 2 deletions

View File

@ -370,7 +370,10 @@ pub(crate) fn codegen_terminator_call<'tcx>(
.map(|inst| fx.tcx.codegen_fn_attrs(inst.def_id()).flags.contains(CodegenFnAttrFlags::COLD))
.unwrap_or(false);
if is_cold {
// FIXME Mark current_block block as cold once Cranelift supports it
fx.bcx.set_cold_block(fx.bcx.current_block().unwrap());
if let Some((_place, destination_block)) = destination {
fx.bcx.set_cold_block(fx.get_block(destination_block));
}
}
// Unpack arguments tuple for closures

View File

@ -303,7 +303,7 @@ fn codegen_fn_content(fx: &mut FunctionCx<'_, '_, '_>) {
let target = fx.get_block(*target);
let failure = fx.bcx.create_block();
// FIXME Mark failure block as cold once Cranelift supports it
fx.bcx.set_cold_block(failure);
if *expected {
fx.bcx.ins().brz(cond, failure, &[]);