pub struct Lower<'func, I: VCodeInst> { /* private fields */ }
Expand description

Machine-independent lowering driver / machine-instruction container. Maintains a correspondence from original Inst to MachInsts.

Implementations

Prepare a new lowering context for the given IR function.

Lower the function.

Trait Implementations

The instruction type for which this lowering framework is instantiated.

Get the ABICallee.

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 controlling type for a polymorphic 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.

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 source location for a given instruction.

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 input.

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

Get a new temp.

Emit a machine instruction.

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

Cause the value in reg to be in a virtual reg, by copying it into a new virtual reg if reg is a real reg. ty describes the type of the value in reg. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.