Merge pull request #9 from Amanieu/remove_is_call

Remove Function::is_call
This commit is contained in:
Chris Fallin
2021-09-09 10:36:58 -07:00
committed by GitHub
4 changed files with 3 additions and 16 deletions

View File

@@ -49,9 +49,8 @@ successors.
Instructions are opaque to the allocator except for a few important
bits: (1) `is_ret` (is a return instruction); (2) `is_branch` (is a
branch instruction); (3) `is_call` (is a call instruction, for
heuristic purposes only), (4) `is_move` (is a move between registers),
and (5) a vector of Operands, covered below. Every block must end in a
branch instruction); (3) `is_move` (is a move between registers), and
(4) a vector of Operands, covered below. Every block must end in a
return or branch.
Both instructions and blocks are named by indices in contiguous index

View File

@@ -15,7 +15,6 @@ use arbitrary::{Arbitrary, Unstructured};
pub enum InstOpcode {
Phi,
Op,
Call,
Ret,
Branch,
}
@@ -104,10 +103,6 @@ impl Function for Func {
&self.block_params[block.index()][..]
}
fn is_call(&self, insn: Inst) -> bool {
self.insts[insn.index()].op == InstOpcode::Call
}
fn is_ret(&self, insn: Inst) -> bool {
self.insts[insn.index()].op == InstOpcode::Ret
}
@@ -500,11 +495,10 @@ impl Func {
.all(|op| !builder.f.reftype_vregs.contains(&op.vreg()))
&& bool::arbitrary(u)?;
let op = *u.choose(&[InstOpcode::Op, InstOpcode::Call])?;
builder.add_inst(
Block::new(block),
InstData {
op,
op: InstOpcode::Op,
operands,
clobbers,
is_safepoint,

View File

@@ -103,8 +103,6 @@ impl<'a, F: Function> Env<'a, F> {
.collect::<Vec<_>>();
let opname = if self.func.is_branch(inst) {
"br"
} else if self.func.is_call(inst) {
"call"
} else if self.func.is_ret(inst) {
"ret"
} else {

View File

@@ -847,10 +847,6 @@ pub trait Function {
/// Get the block parameters for a given block.
fn block_params(&self, block: Block) -> &[VReg];
/// Determine whether an instruction is a call instruction. This is used
/// only for splitting heuristics.
fn is_call(&self, insn: Inst) -> bool;
/// Determine whether an instruction is a return instruction.
fn is_ret(&self, insn: Inst) -> bool;