diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2022-03-13 15:51:39 +0100 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2022-03-13 19:36:40 +0100 |
| commit | 90f8aefe7142d23a64ae95b5ae5a292a6e0519db (patch) | |
| tree | 10eaee905f5fa45c07696cd40f2ac193614d00b2 | |
| parent | 7eb454124f356b8ac1bf60b6474f4458f5be428b (diff) | |
| download | rust-90f8aefe7142d23a64ae95b5ae5a292a6e0519db.tar.gz rust-90f8aefe7142d23a64ae95b5ae5a292a6e0519db.zip | |
Mark cold blocks
| -rw-r--r-- | src/abi/mod.rs | 5 | ||||
| -rw-r--r-- | src/base.rs | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/abi/mod.rs b/src/abi/mod.rs index 2aa80e4d10d..3d527bd72b6 100644 --- a/src/abi/mod.rs +++ b/src/abi/mod.rs @@ -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 diff --git a/src/base.rs b/src/base.rs index c7c9c5eefad..59e9e23d882 100644 --- a/src/base.rs +++ b/src/base.rs @@ -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, &[]); |
