[][src]Struct cranelift_codegen::loop_analysis::LoopAnalysis

pub struct LoopAnalysis { /* fields omitted */ }

Loop tree information for a single function.

Loops are referenced by the Loop object, and for each loop you can access its header EBB, its eventual parent in the loop tree and all the EBB belonging to the loop.

Methods

impl LoopAnalysis[src]

Methods for querying the loop analysis.

pub fn new() -> Self[src]

Allocate a new blank loop analysis struct. Use compute to compute the loop analysis for a function.

pub fn loops(&self) -> Keys<Loop>[src]

Returns all the loops contained in a function.

pub fn loop_header(&self, lp: Loop) -> Ebb[src]

Returns the header EBB of a particular loop.

The characteristic property of a loop header block is that it dominates some of its predecessors.

pub fn loop_parent(&self, lp: Loop) -> Option<Loop>[src]

Return the eventual parent of a loop in the loop tree.

pub fn is_in_loop(&self, ebb: Ebb, lp: Loop) -> bool[src]

Determine if an Ebb belongs to a loop by running a finger along the loop tree.

Returns true if ebb is in loop lp.

pub fn is_child_loop(&self, child: Loop, parent: Loop) -> bool[src]

Determines if a loop is contained in another loop.

is_child_loop(child,parent) returns true if and only if child is a child loop of parent (or child == parent).

impl LoopAnalysis[src]

pub fn compute(
    &mut self,
    func: &Function,
    cfg: &ControlFlowGraph,
    domtree: &DominatorTree
)
[src]

Detects the loops in a function. Needs the control flow graph and the dominator tree.

pub fn is_valid(&self) -> bool[src]

Check if the loop analysis is in a valid state.

Note that this doesn't perform any kind of validity checks. It simply checks if the compute() method has been called since the last clear(). It does not check that the loop analysis is consistent with the CFG.

pub fn clear(&mut self)[src]

Clear all the data structures contained in the loop analysis. This will leave the analysis in a similar state to a context returned by new() except that allocated memory be retained.

Auto Trait Implementations

Blanket Implementations

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]