about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2020-02-14 18:23:29 +0100
committerbjorn3 <bjorn3@users.noreply.github.com>2020-02-14 18:23:29 +0100
commit430f738392dae75954bfa0059025dd18dadeff7d (patch)
treed2ab1d816b329b7186bcb58cc14056f8faf73dd3 /src
parentb5b2ffab6ae4026f8d9a8b552e075fdc81002ec7 (diff)
downloadrust-430f738392dae75954bfa0059025dd18dadeff7d.tar.gz
rust-430f738392dae75954bfa0059025dd18dadeff7d.zip
Update Cranelift for basic blocks
Diffstat (limited to 'src')
-rw-r--r--src/abi/mod.rs24
-rw-r--r--src/abi/pass_mode.rs14
-rw-r--r--src/abi/returning.rs4
-rw-r--r--src/allocator.rs6
-rw-r--r--src/base.rs60
-rw-r--r--src/common.rs10
-rw-r--r--src/debuginfo/line_info.rs8
-rw-r--r--src/intrinsics/llvm.rs4
-rw-r--r--src/intrinsics/mod.rs12
-rw-r--r--src/lib.rs2
-rw-r--r--src/main_shim.rs8
-rw-r--r--src/optimize/code_layout.rs22
-rw-r--r--src/optimize/mod.rs4
-rw-r--r--src/optimize/stack2reg.rs6
-rw-r--r--src/pretty_clif.rs16
-rw-r--r--src/value_and_place.rs6
16 files changed, 103 insertions, 103 deletions
diff --git a/src/abi/mod.rs b/src/abi/mod.rs
index 6d254abb2bf..568165bc61d 100644
--- a/src/abi/mod.rs
+++ b/src/abi/mod.rs
@@ -288,13 +288,13 @@ fn local_place<'tcx>(
     fx.local_map[&local]
 }
 
-pub fn codegen_fn_prelude(fx: &mut FunctionCx<'_, '_, impl Backend>, start_ebb: Ebb) {
+pub fn codegen_fn_prelude(fx: &mut FunctionCx<'_, '_, impl Backend>, start_block: Block) {
     let ssa_analyzed = crate::analyze::analyze(fx);
 
     #[cfg(debug_assertions)]
     self::comments::add_args_header_comment(fx);
 
-    self::returning::codegen_return_param(fx, &ssa_analyzed, start_ebb);
+    self::returning::codegen_return_param(fx, &ssa_analyzed, start_block);
 
     // None means pass_mode == NoPass
     enum ArgKind<'tcx> {
@@ -322,13 +322,13 @@ pub fn codegen_fn_prelude(fx: &mut FunctionCx<'_, '_, impl Backend>, start_ebb:
 
                 let mut params = Vec::new();
                 for (i, arg_ty) in tupled_arg_tys.types().enumerate() {
-                    let param = cvalue_for_param(fx, start_ebb, Some(local), Some(i), arg_ty);
+                    let param = cvalue_for_param(fx, start_block, Some(local), Some(i), arg_ty);
                     params.push(param);
                 }
 
                 (local, ArgKind::Spread(params), arg_ty)
             } else {
-                let param = cvalue_for_param(fx, start_ebb, Some(local), None, arg_ty);
+                let param = cvalue_for_param(fx, start_block, Some(local), None, arg_ty);
                 (local, ArgKind::Normal(param), arg_ty)
             }
         })
@@ -337,10 +337,10 @@ pub fn codegen_fn_prelude(fx: &mut FunctionCx<'_, '_, impl Backend>, start_ebb:
     assert!(fx.caller_location.is_none());
     if fx.instance.def.requires_caller_location(fx.tcx) {
         // Store caller location for `#[track_caller]`.
-        fx.caller_location = Some(cvalue_for_param(fx, start_ebb, None, None, fx.tcx.caller_location_ty()).unwrap());
+        fx.caller_location = Some(cvalue_for_param(fx, start_block, None, None, fx.tcx.caller_location_ty()).unwrap());
     }
 
-    fx.bcx.switch_to_block(start_ebb);
+    fx.bcx.switch_to_block(start_block);
     fx.bcx.ins().nop();
 
     #[cfg(debug_assertions)]
@@ -416,7 +416,7 @@ pub fn codegen_fn_prelude(fx: &mut FunctionCx<'_, '_, impl Backend>, start_ebb:
 
     fx.bcx
         .ins()
-        .jump(*fx.ebb_map.get(START_BLOCK).unwrap(), &[]);
+        .jump(*fx.block_map.get(START_BLOCK).unwrap(), &[]);
 }
 
 pub fn codegen_terminator_call<'tcx>(
@@ -458,8 +458,8 @@ pub fn codegen_terminator_call<'tcx>(
             InstanceDef::DropGlue(_, None) => {
                 // empty drop glue - a nop.
                 let (_, dest) = destination.expect("Non terminating drop_in_place_real???");
-                let ret_ebb = fx.get_ebb(dest);
-                fx.bcx.ins().jump(ret_ebb, &[]);
+                let ret_block = fx.get_block(dest);
+                fx.bcx.ins().jump(ret_block, &[]);
                 return;
             }
             _ => {}
@@ -498,8 +498,8 @@ pub fn codegen_terminator_call<'tcx>(
     );
 
     if let Some((_, dest)) = destination {
-        let ret_ebb = fx.get_ebb(dest);
-        fx.bcx.ins().jump(ret_ebb, &[]);
+        let ret_block = fx.get_block(dest);
+        fx.bcx.ins().jump(ret_block, &[]);
     } else {
         trap_unreachable(fx, "[corruption] Diverging function returned");
     }
@@ -513,7 +513,7 @@ fn codegen_call_inner<'tcx>(
     args: Vec<CValue<'tcx>>,
     ret_place: Option<CPlace<'tcx>>,
 ) {
-    // FIXME mark the current ebb as cold when calling a `#[cold]` function.
+    // FIXME mark the current block as cold when calling a `#[cold]` function.
     let fn_sig = fx
         .tcx
         .normalize_erasing_late_bound_regions(ParamEnv::reveal_all(), &fn_ty.fn_sig(fx.tcx));
diff --git a/src/abi/pass_mode.rs b/src/abi/pass_mode.rs
index bbb231ed8b7..3c19787ef92 100644
--- a/src/abi/pass_mode.rs
+++ b/src/abi/pass_mode.rs
@@ -129,7 +129,7 @@ pub(super) fn adjust_arg_for_abi<'tcx>(
 
 pub(super) fn cvalue_for_param<'tcx>(
     fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
-    start_ebb: Ebb,
+    start_block: Block,
     local: Option<mir::Local>,
     local_field: Option<usize>,
     arg_ty: Ty<'tcx>,
@@ -142,7 +142,7 @@ pub(super) fn cvalue_for_param<'tcx>(
     }
 
     let clif_types = pass_mode.get_param_ty(fx.tcx);
-    let ebb_params = clif_types.map(|t| fx.bcx.append_ebb_param(start_ebb, t));
+    let block_params = clif_types.map(|t| fx.bcx.append_block_param(start_block, t));
 
     #[cfg(debug_assertions)]
     crate::abi::comments::add_arg_comment(
@@ -150,21 +150,21 @@ pub(super) fn cvalue_for_param<'tcx>(
         "arg",
         local,
         local_field,
-        ebb_params,
+        block_params,
         pass_mode,
         arg_ty,
     );
 
     match pass_mode {
         PassMode::NoPass => unreachable!(),
-        PassMode::ByVal(_) => Some(CValue::by_val(ebb_params.assert_single(), layout)),
+        PassMode::ByVal(_) => Some(CValue::by_val(block_params.assert_single(), layout)),
         PassMode::ByValPair(_, _) => {
-            let (a, b) = ebb_params.assert_pair();
+            let (a, b) = block_params.assert_pair();
             Some(CValue::by_val_pair(a, b, layout))
         }
-        PassMode::ByRef { sized: true } => Some(CValue::by_ref(Pointer::new(ebb_params.assert_single()), layout)),
+        PassMode::ByRef { sized: true } => Some(CValue::by_ref(Pointer::new(block_params.assert_single()), layout)),
         PassMode::ByRef { sized: false } => {
-            let (ptr, meta) = ebb_params.assert_pair();
+            let (ptr, meta) = block_params.assert_pair();
             Some(CValue::by_ref_unsized(Pointer::new(ptr), meta, layout))
         }
     }
diff --git a/src/abi/returning.rs b/src/abi/returning.rs
index d76711173f1..b4dd04002cf 100644
--- a/src/abi/returning.rs
+++ b/src/abi/returning.rs
@@ -16,7 +16,7 @@ pub fn can_return_to_ssa_var<'tcx>(tcx: TyCtxt<'tcx>, dest_layout: TyLayout<'tcx
 pub(super) fn codegen_return_param(
     fx: &mut FunctionCx<impl Backend>,
     ssa_analyzed: &rustc_index::vec::IndexVec<Local, crate::analyze::SsaKind>,
-    start_ebb: Ebb,
+    start_block: Block,
 ) {
     let ret_layout = return_layout(fx);
     let ret_pass_mode = get_pass_mode(fx.tcx, ret_layout);
@@ -34,7 +34,7 @@ pub(super) fn codegen_return_param(
             Empty
         }
         PassMode::ByRef { sized: true } => {
-            let ret_param = fx.bcx.append_ebb_param(start_ebb, fx.pointer_type);
+            let ret_param = fx.bcx.append_block_param(start_block, fx.pointer_type);
             fx.local_map
                 .insert(RETURN_PLACE, CPlace::for_ptr(Pointer::new(ret_param), ret_layout));
 
diff --git a/src/allocator.rs b/src/allocator.rs
index df9e6aa1962..8405096f32b 100644
--- a/src/allocator.rs
+++ b/src/allocator.rs
@@ -78,11 +78,11 @@ fn codegen_inner(module: &mut Module<impl Backend + 'static>, kind: AllocatorKin
             let mut func_ctx = FunctionBuilderContext::new();
             let mut bcx = FunctionBuilder::new(&mut ctx.func, &mut func_ctx);
 
-            let ebb = bcx.create_ebb();
-            bcx.switch_to_block(ebb);
+            let block = bcx.create_block();
+            bcx.switch_to_block(block);
             let args = arg_tys
                 .into_iter()
-                .map(|ty| bcx.append_ebb_param(ebb, ty))
+                .map(|ty| bcx.append_block_param(block, ty))
                 .collect::<Vec<Value>>();
 
             let callee_func_ref = module.declare_func_in_func(callee_func_id, &mut bcx.func);
diff --git a/src/base.rs b/src/base.rs
index a0add9b202f..644a66bb31a 100644
--- a/src/base.rs
+++ b/src/base.rs
@@ -29,9 +29,9 @@ pub fn trans_fn<'clif, 'tcx, B: Backend + 'static>(
     let mut func_ctx = FunctionBuilderContext::new();
     let mut bcx = FunctionBuilder::new(&mut context.func, &mut func_ctx);
 
-    // Predefine ebb's
-    let start_ebb = bcx.create_ebb();
-    let ebb_map: IndexVec<BasicBlock, Ebb> = (0..mir.basic_blocks().len()).map(|_| bcx.create_ebb()).collect();
+    // Predefine block's
+    let start_block = bcx.create_block();
+    let block_map: IndexVec<BasicBlock, Block> = (0..mir.basic_blocks().len()).map(|_| bcx.create_block()).collect();
 
     // Make FunctionCx
     let pointer_type = cx.module.target_config().pointer_type();
@@ -46,10 +46,10 @@ pub fn trans_fn<'clif, 'tcx, B: Backend + 'static>(
         mir,
 
         bcx,
-        ebb_map,
+        block_map,
         local_map: HashMap::new(),
         caller_location: None, // set by `codegen_fn_prelude`
-        cold_ebbs: EntitySet::new(),
+        cold_blocks: EntitySet::new(),
 
         clif_comments,
         constants_cx: &mut cx.constants_cx,
@@ -58,13 +58,13 @@ pub fn trans_fn<'clif, 'tcx, B: Backend + 'static>(
     };
 
     if fx.mir.args_iter().any(|arg| fx.layout_of(fx.monomorphize(&fx.mir.local_decls[arg].ty)).abi.is_uninhabited()) {
-        let entry_block = fx.bcx.create_ebb();
-        fx.bcx.append_ebb_params_for_function_params(entry_block);
+        let entry_block = fx.bcx.create_block();
+        fx.bcx.append_block_params_for_function_params(entry_block);
         fx.bcx.switch_to_block(entry_block);
         crate::trap::trap_unreachable(&mut fx, "function has uninhabited argument");
     } else {
         tcx.sess.time("codegen clif ir", || {
-            tcx.sess.time("codegen prelude", || crate::abi::codegen_fn_prelude(&mut fx, start_ebb));
+            tcx.sess.time("codegen prelude", || crate::abi::codegen_fn_prelude(&mut fx, start_block));
             codegen_fn_content(&mut fx);
         });
     }
@@ -74,7 +74,7 @@ pub fn trans_fn<'clif, 'tcx, B: Backend + 'static>(
     let mut clif_comments = fx.clif_comments;
     let source_info_set = fx.source_info_set;
     let local_map = fx.local_map;
-    let cold_ebbs = fx.cold_ebbs;
+    let cold_blocks = fx.cold_blocks;
 
     #[cfg(debug_assertions)]
     crate::pretty_clif::write_clif_file(cx.tcx, "unopt", instance, &context.func, &clif_comments, None);
@@ -84,7 +84,7 @@ pub fn trans_fn<'clif, 'tcx, B: Backend + 'static>(
 
     // Perform rust specific optimizations
     tcx.sess.time("optimize clif ir", || {
-        crate::optimize::optimize_function(tcx, instance, context, &cold_ebbs, &mut clif_comments);
+        crate::optimize::optimize_function(tcx, instance, context, &cold_blocks, &mut clif_comments);
     });
 
     // Define function
@@ -142,22 +142,22 @@ pub fn verify_func(tcx: TyCtxt, writer: &crate::pretty_clif::CommentWriter, func
 
 fn codegen_fn_content(fx: &mut FunctionCx<'_, '_, impl Backend>) {
     for (bb, bb_data) in fx.mir.basic_blocks().iter_enumerated() {
-        let ebb = fx.get_ebb(bb);
-        fx.bcx.switch_to_block(ebb);
+        let block = fx.get_block(bb);
+        fx.bcx.switch_to_block(block);
 
         if bb_data.is_cleanup {
             // Unwinding after panicking is not supported
             continue;
 
             // FIXME once unwinding is supported uncomment next lines
-            // // Unwinding is unlikely to happen, so mark cleanup ebb's as cold.
-            // fx.cold_ebbs.insert(ebb);
+            // // Unwinding is unlikely to happen, so mark cleanup block's as cold.
+            // fx.cold_blocks.insert(block);
         }
 
         fx.bcx.ins().nop();
         for stmt in &bb_data.statements {
             fx.set_debug_loc(stmt.source_info);
-            trans_stmt(fx, ebb, stmt);
+            trans_stmt(fx, block, stmt);
         }
 
         #[cfg(debug_assertions)]
@@ -168,7 +168,7 @@ fn codegen_fn_content(fx: &mut FunctionCx<'_, '_, impl Backend>) {
                 .kind
                 .fmt_head(&mut terminator_head)
                 .unwrap();
-            let inst = fx.bcx.func.layout.last_inst(ebb).unwrap();
+            let inst = fx.bcx.func.layout.last_inst(block).unwrap();
             fx.add_comment(inst, terminator_head);
         }
 
@@ -176,8 +176,8 @@ fn codegen_fn_content(fx: &mut FunctionCx<'_, '_, impl Backend>) {
 
         match &bb_data.terminator().kind {
             TerminatorKind::Goto { target } => {
-                let ebb = fx.get_ebb(*target);
-                fx.bcx.ins().jump(ebb, &[]);
+                let block = fx.get_block(*target);
+                fx.bcx.ins().jump(block, &[]);
             }
             TerminatorKind::Return => {
                 crate::abi::codegen_return(fx);
@@ -191,16 +191,16 @@ fn codegen_fn_content(fx: &mut FunctionCx<'_, '_, impl Backend>) {
             } => {
                 if !fx.tcx.sess.overflow_checks() {
                     if let mir::AssertKind::OverflowNeg = *msg {
-                        let target = fx.get_ebb(*target);
+                        let target = fx.get_block(*target);
                         fx.bcx.ins().jump(target, &[]);
                         continue;
                     }
                 }
                 let cond = trans_operand(fx, cond).load_scalar(fx);
 
-                let target = fx.get_ebb(*target);
-                let failure = fx.bcx.create_ebb();
-                fx.cold_ebbs.insert(failure);
+                let target = fx.get_block(*target);
+                let failure = fx.bcx.create_block();
+                fx.cold_blocks.insert(failure);
 
                 if *expected {
                     fx.bcx.ins().brz(cond, failure, &[]);
@@ -229,11 +229,11 @@ fn codegen_fn_content(fx: &mut FunctionCx<'_, '_, impl Backend>) {
                 let discr = trans_operand(fx, discr).load_scalar(fx);
                 let mut switch = ::cranelift_frontend::Switch::new();
                 for (i, value) in values.iter().enumerate() {
-                    let ebb = fx.get_ebb(targets[i]);
-                    switch.set_entry(*value as u64, ebb);
+                    let block = fx.get_block(targets[i]);
+                    switch.set_entry(*value as u64, block);
                 }
-                let otherwise_ebb = fx.get_ebb(targets[targets.len() - 1]);
-                switch.emit(&mut fx.bcx, discr, otherwise_ebb);
+                let otherwise_block = fx.get_block(targets[targets.len() - 1]);
+                switch.emit(&mut fx.bcx, discr, otherwise_block);
             }
             TerminatorKind::Call {
                 func,
@@ -271,8 +271,8 @@ fn codegen_fn_content(fx: &mut FunctionCx<'_, '_, impl Backend>) {
                 let drop_place = trans_place(fx, location);
                 crate::abi::codegen_drop(fx, bb_data.terminator().source_info.span, drop_place);
 
-                let target_ebb = fx.get_ebb(*target);
-                fx.bcx.ins().jump(target_ebb, &[]);
+                let target_block = fx.get_block(*target);
+                fx.bcx.ins().jump(target_block, &[]);
             }
         };
     }
@@ -283,7 +283,7 @@ fn codegen_fn_content(fx: &mut FunctionCx<'_, '_, impl Backend>) {
 
 fn trans_stmt<'tcx>(
     fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
-    cur_ebb: Ebb,
+    cur_block: Block,
     stmt: &Statement<'tcx>,
 ) {
     let _print_guard = PrintOnPanic(|| format!("stmt {:?}", stmt));
@@ -294,7 +294,7 @@ fn trans_stmt<'tcx>(
     match &stmt.kind {
         StatementKind::StorageLive(..) | StatementKind::StorageDead(..) => {} // Those are not very useful
         _ => {
-            let inst = fx.bcx.func.layout.last_inst(cur_ebb).unwrap();
+            let inst = fx.bcx.func.layout.last_inst(cur_block).unwrap();
             fx.add_comment(inst, format!("{:?}", stmt));
         }
     }
diff --git a/src/common.rs b/src/common.rs
index a1d0203828e..374ad0acee5 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -264,14 +264,14 @@ pub struct FunctionCx<'clif, 'tcx, B: Backend + 'static> {
     pub mir: &'tcx Body<'tcx>,
 
     pub bcx: FunctionBuilder<'clif>,
-    pub ebb_map: IndexVec<BasicBlock, Ebb>,
+    pub block_map: IndexVec<BasicBlock, Block>,
     pub local_map: HashMap<Local, CPlace<'tcx>>,
 
     /// When `#[track_caller]` is used, the implicit caller location is stored in this variable.
     pub caller_location: Option<CValue<'tcx>>,
 
     /// See [crate::optimize::code_layout] for more information.
-    pub cold_ebbs: EntitySet<Ebb>,
+    pub cold_blocks: EntitySet<Block>,
 
     pub clif_comments: crate::pretty_clif::CommentWriter,
     pub constants_cx: &'clif mut crate::constant::ConstantCx,
@@ -325,7 +325,7 @@ impl<'tcx, B: Backend + 'static> HasTargetSpec for FunctionCx<'_, 'tcx, B> {
 impl<'tcx, B: Backend> BackendTypes for FunctionCx<'_, 'tcx, B> {
     type Value = Value;
     type Function = Value;
-    type BasicBlock = Ebb;
+    type BasicBlock = Block;
     type Type = Type;
     type Funclet = !;
     type DIScope = !;
@@ -348,8 +348,8 @@ impl<'tcx, B: Backend + 'static> FunctionCx<'_, 'tcx, B> {
         clif_type_from_ty(self.tcx, ty)
     }
 
-    pub fn get_ebb(&self, bb: BasicBlock) -> Ebb {
-        *self.ebb_map.get(bb).unwrap()
+    pub fn get_block(&self, bb: BasicBlock) -> Block {
+        *self.block_map.get(bb).unwrap()
     }
 
     pub fn get_local_place(&mut self, local: Local) -> CPlace<'tcx> {
diff --git a/src/debuginfo/line_info.rs b/src/debuginfo/line_info.rs
index 3152e4812f7..7a3ac0991c4 100644
--- a/src/debuginfo/line_info.rs
+++ b/src/debuginfo/line_info.rs
@@ -118,8 +118,8 @@ impl<'a, 'tcx> FunctionDebugContext<'a, 'tcx> {
 
         let encinfo = isa.encoding_info();
         let func = &context.func;
-        let mut ebbs = func.layout.ebbs().collect::<Vec<_>>();
-        ebbs.sort_by_key(|ebb| func.offsets[*ebb]); // Ensure inst offsets always increase
+        let mut blocks = func.layout.blocks().collect::<Vec<_>>();
+        blocks.sort_by_key(|block| func.offsets[*block]); // Ensure inst offsets always increase
 
         let line_strings = &mut self.debug_context.dwarf.line_strings;
         let mut last_file = None;
@@ -147,8 +147,8 @@ impl<'a, 'tcx> FunctionDebugContext<'a, 'tcx> {
         };
 
         let mut end = 0;
-        for ebb in ebbs {
-            for (offset, inst, size) in func.inst_offsets(ebb, &encinfo) {
+        for block in blocks {
+            for (offset, inst, size) in func.inst_offsets(block, &encinfo) {
                 let srcloc = func.srclocs[inst];
                 line_program.row().address_offset = offset as u64;
                 if !srcloc.is_default() {
diff --git a/src/intrinsics/llvm.rs b/src/intrinsics/llvm.rs
index 5b3deb52baa..b30f3b8f8db 100644
--- a/src/intrinsics/llvm.rs
+++ b/src/intrinsics/llvm.rs
@@ -97,8 +97,8 @@ pub fn codegen_llvm_intrinsic_call<'tcx>(
     }
 
     if let Some((_, dest)) = destination {
-        let ret_ebb = fx.get_ebb(dest);
-        fx.bcx.ins().jump(ret_ebb, &[]);
+        let ret_block = fx.get_block(dest);
+        fx.bcx.ins().jump(ret_block, &[]);
     } else {
         trap_unreachable(fx, "[corruption] Diverging intrinsic returned.");
     }
diff --git a/src/intrinsics/mod.rs b/src/intrinsics/mod.rs
index 7470b55366c..d23d28dccd2 100644
--- a/src/intrinsics/mod.rs
+++ b/src/intrinsics/mod.rs
@@ -87,8 +87,8 @@ macro call_intrinsic_match {
                         $ret.write_cvalue($fx, res);
 
                         if let Some((_, dest)) = $destination {
-                            let ret_ebb = $fx.get_ebb(dest);
-                            $fx.bcx.ins().jump(ret_ebb, &[]);
+                            let ret_block = $fx.get_block(dest);
+                            $fx.bcx.ins().jump(ret_block, &[]);
                             return;
                         } else {
                             unreachable!();
@@ -369,8 +369,8 @@ pub fn codegen_intrinsic_call<'tcx>(
 
     if intrinsic.starts_with("simd_") {
         self::simd::codegen_simd_intrinsic_call(fx, instance, args, ret, span);
-        let ret_ebb = fx.get_ebb(destination.expect("SIMD intrinsics don't diverge").1);
-        fx.bcx.ins().jump(ret_ebb, &[]);
+        let ret_block = fx.get_block(destination.expect("SIMD intrinsics don't diverge").1);
+        fx.bcx.ins().jump(ret_block, &[]);
         return;
     }
 
@@ -992,8 +992,8 @@ pub fn codegen_intrinsic_call<'tcx>(
     }
 
     if let Some((_, dest)) = destination {
-        let ret_ebb = fx.get_ebb(dest);
-        fx.bcx.ins().jump(ret_ebb, &[]);
+        let ret_block = fx.get_block(dest);
+        fx.bcx.ins().jump(ret_block, &[]);
     } else {
         trap_unreachable(fx, "[corruption] Diverging intrinsic returned.");
     }
diff --git a/src/lib.rs b/src/lib.rs
index ad2ad82f0f2..21fca3c89f6 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -98,7 +98,7 @@ mod prelude {
 
     pub use cranelift_codegen::Context;
     pub use cranelift_codegen::entity::EntitySet;
-    pub use cranelift_codegen::ir::{AbiParam, Ebb, ExternalName, FuncRef, Inst, InstBuilder, MemFlags, Signature, SourceLoc, StackSlot, StackSlotData, StackSlotKind, TrapCode, Type, Value};
+    pub use cranelift_codegen::ir::{AbiParam, Block, ExternalName, FuncRef, Inst, InstBuilder, MemFlags, Signature, SourceLoc, StackSlot, StackSlotData, StackSlotKind, TrapCode, Type, Value};
     pub use cranelift_codegen::ir::condcodes::{FloatCC, IntCC};
     pub use cranelift_codegen::ir::function::Function;
     pub use cranelift_codegen::ir::immediates::{Ieee32, Ieee64};
diff --git a/src/main_shim.rs b/src/main_shim.rs
index b7c1425a1af..fc3f9734874 100644
--- a/src/main_shim.rs
+++ b/src/main_shim.rs
@@ -62,10 +62,10 @@ pub fn maybe_create_entry_wrapper(tcx: TyCtxt<'_>, module: &mut Module<impl Back
             let mut func_ctx = FunctionBuilderContext::new();
             let mut bcx: FunctionBuilder = FunctionBuilder::new(&mut ctx.func, &mut func_ctx);
 
-            let ebb = bcx.create_ebb();
-            bcx.switch_to_block(ebb);
-            let arg_argc = bcx.append_ebb_param(ebb, m.target_config().pointer_type());
-            let arg_argv = bcx.append_ebb_param(ebb, m.target_config().pointer_type());
+            let block = bcx.create_block();
+            bcx.switch_to_block(block);
+            let arg_argc = bcx.append_block_param(block, m.target_config().pointer_type());
+            let arg_argv = bcx.append_block_param(block, m.target_config().pointer_type());
 
             crate::atomic_shim::init_global_lock(m, &mut bcx);
 
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<Ebb>) {
-    // FIXME Move the ebb in place instead of remove and append once
+pub(super) fn optimize_function(ctx: &mut Context, cold_blocks: &EntitySet<Block>) {
+    // 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::<Vec<_>>();
+    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::<Vec<_>>();
         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);
         }
     }
 }
diff --git a/src/optimize/mod.rs b/src/optimize/mod.rs
index ba9839e84be..23c14a57c56 100644
--- a/src/optimize/mod.rs
+++ b/src/optimize/mod.rs
@@ -7,11 +7,11 @@ pub fn optimize_function<'tcx>(
     tcx: TyCtxt<'tcx>,
     instance: Instance<'tcx>,
     ctx: &mut Context,
-    cold_ebbs: &EntitySet<Ebb>,
+    cold_blocks: &EntitySet<Block>,
     clif_comments: &mut crate::pretty_clif::CommentWriter,
 ) {
     // The code_layout optimization is very cheap.
-    self::code_layout::optimize_function(ctx, cold_ebbs);
+    self::code_layout::optimize_function(ctx, cold_blocks);
 
     if tcx.sess.opts.optimize == rustc_session::config::OptLevel::No {
         return; // FIXME classify optimizations over opt levels
diff --git a/src/optimize/stack2reg.rs b/src/optimize/stack2reg.rs
index 8fa5fb13c2e..acce3a6465b 100644
--- a/src/optimize/stack2reg.rs
+++ b/src/optimize/stack2reg.rs
@@ -116,7 +116,7 @@ impl<'a> OptimizeContext<'a> {
         let mut stack_slot_usage_map = BTreeMap::<OrdStackSlot, StackSlotUsage>::new();
 
         let mut cursor = FuncCursor::new(&mut ctx.func);
-        while let Some(_ebb) = cursor.next_ebb() {
+        while let Some(_block) = cursor.next_block() {
             while let Some(inst) = cursor.next_inst() {
                 match cursor.func.dfg[inst] {
                     InstructionData::StackLoad {
@@ -249,7 +249,7 @@ pub(super) fn optimize_function<T: std::fmt::Debug>(
 fn combine_stack_addr_with_load_store(func: &mut Function) {
     // Turn load and store into stack_load and stack_store when possible.
     let mut cursor = FuncCursor::new(func);
-    while let Some(_ebb) = cursor.next_ebb() {
+    while let Some(_block) = cursor.next_block() {
         while let Some(inst) = cursor.next_inst() {
             match cursor.func.dfg[inst] {
                 InstructionData::Load { opcode: Opcode::Load, arg: addr, flags: _, offset } => {
@@ -284,7 +284,7 @@ fn remove_unused_stack_addr_and_stack_load(opt_ctx: &mut OptimizeContext) {
     let mut stack_addr_load_insts_users = HashMap::<Inst, HashSet<Inst>>::new();
 
     let mut cursor = FuncCursor::new(&mut opt_ctx.ctx.func);
-    while let Some(_ebb) = cursor.next_ebb() {
+    while let Some(_block) = cursor.next_block() {
         while let Some(inst) = cursor.next_inst() {
             for &arg in cursor.func.dfg.inst_args(inst) {
                 if let ValueDef::Result(arg_origin, 0) = cursor.func.dfg.value_def(arg) {
diff --git a/src/pretty_clif.rs b/src/pretty_clif.rs
index 06be1636f80..e619be41cb1 100644
--- a/src/pretty_clif.rs
+++ b/src/pretty_clif.rs
@@ -38,14 +38,14 @@ use crate::prelude::*;
 ///     sig1 = (i64, i64, i64) system_v
 ///     fn0 = colocated u0:6 sig1 ; Instance { def: Item(DefId(0/0:31 ~ example[8787]::{{impl}}[1]::call_mut[0])), substs: [ReErased, ReErased] }
 ///
-/// ebb0(v0: i64, v1: i64, v2: i64):
+/// block0(v0: i64, v1: i64, v2: i64):
 ///     v3 = stack_addr.i64 ss0
 ///     v4 = stack_addr.i64 ss1
 ///     store v2, v4
 ///     v5 = stack_addr.i64 ss2
-///     jump ebb1
+///     jump block1
 ///
-/// ebb1:
+/// block1:
 ///     nop
 /// ; _3 = &mut _1
 /// ; _4 = _2
@@ -55,9 +55,9 @@ use crate::prelude::*;
 /// ; _0 = const mini_core::FnMut::call_mut(move _3, move _4)
 ///     v7 = load.i64 v5
 ///     call fn0(v0, v3, v7)
-///     jump ebb2
+///     jump block2
 ///
-/// ebb2:
+/// block2:
 ///     nop
 /// ;
 /// ; return
@@ -136,15 +136,15 @@ impl FuncWriter for &'_ CommentWriter {
         }
     }
 
-    fn write_ebb_header(
+    fn write_block_header(
         &mut self,
         w: &mut dyn fmt::Write,
         func: &Function,
         isa: Option<&dyn isa::TargetIsa>,
-        ebb: Ebb,
+        block: Block,
         indent: usize,
     ) -> fmt::Result {
-        PlainWriter.write_ebb_header(w, func, isa, ebb, indent)
+        PlainWriter.write_block_header(w, func, isa, block, indent)
     }
 
     fn write_instruction(
diff --git a/src/value_and_place.rs b/src/value_and_place.rs
index 882eb82f5aa..cc194e1c91e 100644
--- a/src/value_and_place.rs
+++ b/src/value_and_place.rs
@@ -382,12 +382,12 @@ impl<'tcx> CPlace<'tcx> {
         #[cfg(debug_assertions)]
         {
             use cranelift_codegen::cursor::{Cursor, CursorPosition};
-            let cur_ebb = match fx.bcx.cursor().position() {
-                CursorPosition::After(ebb) => ebb,
+            let cur_block = match fx.bcx.cursor().position() {
+                CursorPosition::After(block) => block,
                 _ => unreachable!(),
             };
             fx.add_comment(
-                fx.bcx.func.layout.last_inst(cur_ebb).unwrap(),
+                fx.bcx.func.layout.last_inst(cur_block).unwrap(),
                 format!("write_cvalue: {:?} <- {:?}",self, from),
             );
         }