From 430f738392dae75954bfa0059025dd18dadeff7d Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Fri, 14 Feb 2020 18:23:29 +0100 Subject: Update Cranelift for basic blocks --- src/optimize/code_layout.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/optimize/code_layout.rs') diff --git a/src/optimize/code_layout.rs b/src/optimize/code_layout.rs index 4d2301c6f6c..7e910fe08be 100644 --- a/src/optimize/code_layout.rs +++ b/src/optimize/code_layout.rs @@ -10,25 +10,25 @@ use crate::prelude::*; -pub(super) fn optimize_function(ctx: &mut Context, cold_ebbs: &EntitySet) { - // FIXME Move the ebb in place instead of remove and append once +pub(super) fn optimize_function(ctx: &mut Context, cold_blocks: &EntitySet) { + // FIXME Move the block in place instead of remove and append once // bytecodealliance/cranelift#1339 is implemented. - let mut ebb_insts = HashMap::new(); - for ebb in cold_ebbs.keys().filter(|&ebb| cold_ebbs.contains(ebb)) { - let insts = ctx.func.layout.ebb_insts(ebb).collect::>(); + let mut block_insts = HashMap::new(); + for block in cold_blocks.keys().filter(|&block| cold_blocks.contains(block)) { + let insts = ctx.func.layout.block_insts(block).collect::>(); for &inst in &insts { ctx.func.layout.remove_inst(inst); } - ebb_insts.insert(ebb, insts); - ctx.func.layout.remove_ebb(ebb); + block_insts.insert(block, insts); + ctx.func.layout.remove_block(block); } // And then append them at the back again. - for ebb in cold_ebbs.keys().filter(|&ebb| cold_ebbs.contains(ebb)) { - ctx.func.layout.append_ebb(ebb); - for inst in ebb_insts.remove(&ebb).unwrap() { - ctx.func.layout.append_inst(inst, ebb); + for block in cold_blocks.keys().filter(|&block| cold_blocks.contains(block)) { + ctx.func.layout.append_block(block); + for inst in block_insts.remove(&block).unwrap() { + ctx.func.layout.append_inst(inst, block); } } } -- cgit 1.4.1-3-g733a5