Struct regalloc2::Output

source ·
pub struct Output {
    pub num_spillslots: usize,
    pub edits: Vec<(ProgPoint, Edit)>,
    pub allocs: Vec<Allocation>,
    pub inst_alloc_offsets: Vec<u32>,
    pub safepoint_slots: Vec<(ProgPoint, Allocation)>,
    pub debug_locations: Vec<(u32, ProgPoint, ProgPoint, Allocation)>,
    pub stats: Stats,
}
Expand description

The output of the register allocator.

Fields§

§num_spillslots: usize

How many spillslots are needed in the frame?

§edits: Vec<(ProgPoint, Edit)>

Edits (insertions or removals). Guaranteed to be sorted by program point.

§allocs: Vec<Allocation>

Allocations for each operand. Mapping from instruction to allocations provided by inst_alloc_offsets below.

§inst_alloc_offsets: Vec<u32>

Allocation offset in allocs for each instruction.

§safepoint_slots: Vec<(ProgPoint, Allocation)>

Safepoint records: at a given program point, a reference-typed value lives in the given Allocation. Currently these are guaranteed to be stack slots, but in the future an option may be added to allow reftype value to be kept in registers at safepoints.

§debug_locations: Vec<(u32, ProgPoint, ProgPoint, Allocation)>

Debug info: a labeled value (as applied to vregs by Function::debug_value_labels() on the input side) is located in the given allocation from the first program point (inclusive) to the second (exclusive). Guaranteed to be sorted by label and program point, and the ranges are guaranteed to be disjoint.

§stats: Stats

Internal stats from the allocator.

Implementations§

source§

impl Output

source

pub fn inst_allocs(&self, inst: Inst) -> &[Allocation]

Get the allocations assigned to a given instruction.

source

pub fn block_insts_and_edits( &self, func: &impl Function, block: Block, ) -> OutputIter<'_>

Returns an iterator over the instructions and edits in a block, in order.

Trait Implementations§

source§

impl Clone for Output

source§

fn clone(&self) -> Output

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Output

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Output

§

impl RefUnwindSafe for Output

§

impl Send for Output

§

impl Sync for Output

§

impl Unpin for Output

§

impl UnwindSafe for Output

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.