Skip to content

Commit 90f8aef

Browse files
committed
Mark cold blocks
1 parent 7eb4541 commit 90f8aef

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/abi/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,10 @@ pub(crate) fn codegen_terminator_call<'tcx>(
370370
.map(|inst| fx.tcx.codegen_fn_attrs(inst.def_id()).flags.contains(CodegenFnAttrFlags::COLD))
371371
.unwrap_or(false);
372372
if is_cold {
373-
// FIXME Mark current_block block as cold once Cranelift supports it
373+
fx.bcx.set_cold_block(fx.bcx.current_block().unwrap());
374+
if let Some((_place, destination_block)) = destination {
375+
fx.bcx.set_cold_block(fx.get_block(destination_block));
376+
}
374377
}
375378

376379
// Unpack arguments tuple for closures

src/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ fn codegen_fn_content(fx: &mut FunctionCx<'_, '_, '_>) {
303303

304304
let target = fx.get_block(*target);
305305
let failure = fx.bcx.create_block();
306-
// FIXME Mark failure block as cold once Cranelift supports it
306+
fx.bcx.set_cold_block(failure);
307307

308308
if *expected {
309309
fx.bcx.ins().brz(cond, failure, &[]);

0 commit comments

Comments
 (0)