pub struct DominatorTreePreorder { /* private fields */ }
Expand description
Optional pre-order information that can be computed for a dominator tree.
This data structure is computed from a DominatorTree
and provides:
- A forward traversable dominator tree through the
children()
iterator. - An ordering of blocks according to a dominator tree pre-order.
- Constant time dominance checks at the block granularity.
The information in this auxiliary data structure is not easy to update when the control flow graph changes, which is why it is kept separate.
Implementations
sourceimpl DominatorTreePreorder
impl DominatorTreePreorder
Creating and computing the dominator tree pre-order.
sourceimpl DominatorTreePreorder
impl DominatorTreePreorder
Query interface for the dominator tree pre-order.
sourcepub fn children(&self, block: Block) -> ChildIter<'_>ⓘNotable traits for ChildIter<'a>impl<'a> Iterator for ChildIter<'a> type Item = Block;
pub fn children(&self, block: Block) -> ChildIter<'_>ⓘNotable traits for ChildIter<'a>impl<'a> Iterator for ChildIter<'a> type Item = Block;
Get an iterator over the direct children of block
in the dominator tree.
These are the block’s whose immediate dominator is an instruction in block
, ordered according
to the CFG reverse post-order.
sourcepub fn dominates(&self, a: Block, b: Block) -> bool
pub fn dominates(&self, a: Block, b: Block) -> bool
Fast, constant time dominance check with block granularity.
This computes the same result as domtree.dominates(a, b)
, but in guaranteed fast constant
time. This is less general than the DominatorTree
method because it only works with block
program points.
A block is considered to dominate itself.
sourcepub fn pre_cmp_block(&self, a: Block, b: Block) -> Ordering
pub fn pre_cmp_block(&self, a: Block, b: Block) -> Ordering
Compare two blocks according to the dominator pre-order.
sourcepub fn pre_cmp<A, B>(&self, a: A, b: B, layout: &Layout) -> Ordering where
A: Into<ExpandedProgramPoint>,
B: Into<ExpandedProgramPoint>,
pub fn pre_cmp<A, B>(&self, a: A, b: B, layout: &Layout) -> Ordering where
A: Into<ExpandedProgramPoint>,
B: Into<ExpandedProgramPoint>,
Compare two program points according to the dominator tree pre-order.
This ordering of program points have the property that given a program point, pp, all the program points dominated by pp follow immediately and contiguously after pp in the order.
sourcepub fn pre_cmp_def(&self, a: Value, b: Value, func: &Function) -> Ordering
pub fn pre_cmp_def(&self, a: Value, b: Value, func: &Function) -> Ordering
Compare two value defs according to the dominator tree pre-order.
Two values defined at the same program point are compared according to their parameter or result order.
This is a total ordering of the values in the function.
Auto Trait Implementations
impl RefUnwindSafe for DominatorTreePreorder
impl Send for DominatorTreePreorder
impl Sync for DominatorTreePreorder
impl Unpin for DominatorTreePreorder
impl UnwindSafe for DominatorTreePreorder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more