Merge pull request #3698 from cfallin/cold-blocks

Cranelift: add support for cold blocks.
This commit is contained in:
Chris Fallin
2022-01-19 12:58:33 -08:00
committed by GitHub
3 changed files with 36 additions and 1 deletions

View File

@@ -229,6 +229,14 @@ impl<'a> FunctionBuilder<'a> {
block
}
/// Mark a block as "cold".
///
/// This will try to move it out of the ordinary path of execution
/// when lowered to machine code.
pub fn set_cold_block(&mut self, block: Block) {
self.func.layout.set_cold(block);
}
/// Insert `block` in the layout *after* the existing block `after`.
pub fn insert_block_after(&mut self, block: Block, after: Block) {
self.func.layout.insert_block_after(block, after);