pub struct LayoutAnalysis {
pub entry_layouts: FxHashMap<(usize, usize), Vec<TargetSlot>>,
pub block_exit_layouts: FxHashMap<usize, Vec<TargetSlot>>,
}Expand description
Computes the ideal entry layout for an instruction given the desired exit layout.
This is the core of backward layout analysis:
- Given what we want after the instruction (exit layout)
- Compute what we need before the instruction (entry layout)
Fields§
§entry_layouts: FxHashMap<(usize, usize), Vec<TargetSlot>>Ideal entry layouts for each instruction (block_id, inst_idx) -> layout.
block_exit_layouts: FxHashMap<usize, Vec<TargetSlot>>Ideal exit layouts for each block.
Implementations§
Source§impl LayoutAnalysis
impl LayoutAnalysis
Sourcepub fn analyze_backward(
instructions: &[(Vec<ValueId>, Option<ValueId>)],
exit_layout: &[TargetSlot],
) -> Vec<TargetSlot>
pub fn analyze_backward( instructions: &[(Vec<ValueId>, Option<ValueId>)], exit_layout: &[TargetSlot], ) -> Vec<TargetSlot>
Analyzes a sequence of instructions backward to compute ideal layouts.
Given:
- A sequence of (operands, result) pairs representing instructions
- The desired exit layout after the last instruction
Returns the ideal entry layout before the first instruction.
Trait Implementations§
Source§impl Clone for LayoutAnalysis
impl Clone for LayoutAnalysis
Source§fn clone(&self) -> LayoutAnalysis
fn clone(&self) -> LayoutAnalysis
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LayoutAnalysis
impl Debug for LayoutAnalysis
Auto Trait Implementations§
impl Freeze for LayoutAnalysis
impl RefUnwindSafe for LayoutAnalysis
impl Send for LayoutAnalysis
impl Sync for LayoutAnalysis
impl Unpin for LayoutAnalysis
impl UnsafeUnpin for LayoutAnalysis
impl UnwindSafe for LayoutAnalysis
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more