Struct regalloc2::moves::ParallelMoves

source ·
pub struct ParallelMoves<T: Clone + Copy + Default> { /* private fields */ }
Expand description

A ParallelMoves represents a list of alloc-to-alloc moves that must happen in parallel – i.e., all reads of sources semantically happen before all writes of destinations, and destinations are allowed to overwrite sources. It can compute a list of sequential moves that will produce the equivalent data movement, possibly using a scratch register if one is necessary.

Implementations§

source§

impl<T: Clone + Copy + Default + PartialEq> ParallelMoves<T>

source

pub fn new() -> Self

source

pub fn add(&mut self, from: Allocation, to: Allocation, t: T)

source

pub fn resolve(self) -> MoveVecWithScratch<T>

Resolve the parallel-moves problem to a sequence of separate moves, such that the combined effect of the sequential moves is as-if all of the moves added to this ParallelMoves resolver happened in parallel.

Sometimes, if there is a cycle, a scratch register is necessary to allow the moves to occur sequentially. In this case, Allocation::none() is returned to represent the scratch register. The caller may choose to always hold a separate scratch register unused to allow this to be trivially rewritten; or may dynamically search for or create a free register as needed, if none are available.

Auto Trait Implementations§

§

impl<T> Freeze for ParallelMoves<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for ParallelMoves<T>
where T: RefUnwindSafe,

§

impl<T> Send for ParallelMoves<T>
where T: Send,

§

impl<T> Sync for ParallelMoves<T>
where T: Sync,

§

impl<T> Unpin for ParallelMoves<T>
where T: Unpin,

§

impl<T> UnwindSafe for ParallelMoves<T>

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