Struct cranelift_codegen::machinst::lower::Lower [−][src]
pub struct Lower<'func, I: VCodeInst> { /* fields omitted */ }
Expand description
Machine-independent lowering driver / machine-instruction container. Maintains a correspondence from original Inst to MachInsts.
Implementations
pub fn new(
f: &'func Function,
abi: Box<dyn ABICallee<I = I>>,
emit_info: I::Info,
block_order: BlockLoweringOrder
) -> CodegenResult<Lower<'func, I>>[src]
pub fn new(
f: &'func Function,
abi: Box<dyn ABICallee<I = I>>,
emit_info: I::Info,
block_order: BlockLoweringOrder
) -> CodegenResult<Lower<'func, I>>[src]Prepare a new lowering context for the given IR function.
pub fn lower<B: LowerBackend<MInst = I>>(
self,
backend: &B
) -> CodegenResult<(VCode<I>, StackmapRequestInfo)>[src]
pub fn lower<B: LowerBackend<MInst = I>>(
self,
backend: &B
) -> CodegenResult<(VCode<I>, StackmapRequestInfo)>[src]Lower the function.
Trait Implementations
type I = I
type I = IThe instruction type for which this lowering framework is instantiated.
Get the (virtual) register that receives the return value. A return instruction should lower into a sequence that fills this register. (Why not allow the backend to specify its own result register for the return? Because there may be multiple return points.) Read more
Returns the vreg containing the VmContext parameter, if there’s one.
Get the instdata for a given IR instruction.
Get the target for a call instruction, as an ExternalName. Returns a tuple
providing this name and the “relocation distance”, i.e., whether the backend
can assume the target will be “nearby” (within some small offset) or an
arbitrary address. (This comes from the colocated bit in the CLIF.) Read more
Get the signature for a call or call-indirect instruction.
fn symbol_value<'b>(
&'b self,
ir_inst: Inst
) -> Option<(&'b ExternalName, RelocDistance, i64)>[src]
fn symbol_value<'b>(
&'b self,
ir_inst: Inst
) -> Option<(&'b ExternalName, RelocDistance, i64)>[src]Get the symbol name, relocation distance estimate, and offset for a symbol_value instruction. Read more
Returns the memory flags of a given memory access.
Get the number of inputs to the given IR instruction.
Get the number of outputs to the given IR instruction.
Get the type for an instruction’s output.
Get the value of a constant instruction (iconst, etc.) as a 64-bit
value, if possible. Read more
Get the input as one of two options other than a direct register: Read more
Put the idxth input into register(s) and return the assigned register.
Get the idxth output register(s) of the given IR instruction. When
backend.lower_inst_to_regs(ctx, inst) is called, it is expected that
the backend will write results to these output register(s). This
register will always be “fresh”; it is guaranteed not to overlap with
any of the inputs, and can be freely used as a scratch register within
the lowered instruction sequence, as long as its final value is the
result of the computation. Read more
Emit a machine instruction that is a safepoint.
Indicate that the side-effect of an instruction has been sunk to the
current scan location. This should only be done with the instruction’s
original results are not used (i.e., put_input_in_regs is not invoked
for the input produced by the sunk instruction), otherwise the
side-effect will occur twice. Read more
Retrieve constant data given a handle.
Indicate that a constant should be emitted.
Retrieve the value immediate from an instruction. This will perform necessary lookups on the
DataFlowGraph to retrieve even large immediates. Read more
Auto Trait Implementations
impl<'func, I> !RefUnwindSafe for Lower<'func, I>impl<'func, I> !UnwindSafe for Lower<'func, I>