Trait cranelift_codegen::machinst::lower::LowerBackend
source · [−]pub trait LowerBackend {
type MInst: VCodeInst;
fn lower<C: LowerCtx<I = Self::MInst>>(
&self,
ctx: &mut C,
inst: Inst
) -> CodegenResult<()>;
fn lower_branch_group<C: LowerCtx<I = Self::MInst>>(
&self,
ctx: &mut C,
insts: &[Inst],
targets: &[MachLabel]
) -> CodegenResult<()>;
fn maybe_pinned_reg(&self) -> Option<Reg> { ... }
}
Expand description
A machine backend.
Associated Types
Required methods
Lower a single instruction.
For a branch, this function should not generate the actual branch
instruction. However, it must force any values it needs for the branch
edge (block-param actuals) into registers, because the actual branch
generation (lower_branch_group()
) happens after any possible merged
out-edge.
Provided methods
fn maybe_pinned_reg(&self) -> Option<Reg>
fn maybe_pinned_reg(&self) -> Option<Reg>
A bit of a hack: give a fixed register that always holds the result of a
get_pinned_reg
instruction, if known. This allows elision of moves
into the associated vreg, instead using the real reg directly.