mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-10 23:06:23 +00:00
Mark cold blocks
This commit is contained in:
parent
7eb454124f
commit
90f8aefe71
@ -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))
|
.map(|inst| fx.tcx.codegen_fn_attrs(inst.def_id()).flags.contains(CodegenFnAttrFlags::COLD))
|
||||||
.unwrap_or(false);
|
.unwrap_or(false);
|
||||||
if is_cold {
|
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
|
// Unpack arguments tuple for closures
|
||||||
|
@ -303,7 +303,7 @@ fn codegen_fn_content(fx: &mut FunctionCx<'_, '_, '_>) {
|
|||||||
|
|
||||||
let target = fx.get_block(*target);
|
let target = fx.get_block(*target);
|
||||||
let failure = fx.bcx.create_block();
|
let failure = fx.bcx.create_block();
|
||||||
// FIXME Mark failure block as cold once Cranelift supports it
|
fx.bcx.set_cold_block(failure);
|
||||||
|
|
||||||
if *expected {
|
if *expected {
|
||||||
fx.bcx.ins().brz(cond, failure, &[]);
|
fx.bcx.ins().brz(cond, failure, &[]);
|
||||||
|
Loading…
Reference in New Issue
Block a user