pub struct IteratedDominanceFrontierResult {
pub phi_nodes: AHashSet<i64>,
pub iterations: usize,
}Expand description
Iterated dominance frontier result (for SSA φ-placement).
The iterated dominance frontier finds all nodes that need φ-functions for a
given set of definition nodes. This is computed by fixed-point iteration:
IDF(S) = DF(S) ∪ DF(DF(S)) ∪ DF(DF(DF(S))) ∪ ...
§Example
ⓘ
use ahash::AHashSet;
let mut definitions = AHashSet::new();
definitions.insert(1);
definitions.insert(3);
let idf_result = iterated_dominance_frontiers(&graph, &dom_result, &definitions)?;
println!("Place φ-nodes at: {:?}", idf_result.phi_nodes);
println!("Converged in {} iterations", idf_result.iterations);Fields§
§phi_nodes: AHashSet<i64>Set of nodes that need φ-functions.
This is the fixed-point result of iterated dominance frontier computation. All nodes in this set should have φ-nodes placed during SSA construction.
iterations: usizeNumber of iterations to reach fixed point.
Useful for understanding CFG complexity. Small values (2-4) are typical for well-structured programs.
Trait Implementations§
Source§impl Clone for IteratedDominanceFrontierResult
impl Clone for IteratedDominanceFrontierResult
Source§fn clone(&self) -> IteratedDominanceFrontierResult
fn clone(&self) -> IteratedDominanceFrontierResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for IteratedDominanceFrontierResult
impl RefUnwindSafe for IteratedDominanceFrontierResult
impl Send for IteratedDominanceFrontierResult
impl Sync for IteratedDominanceFrontierResult
impl Unpin for IteratedDominanceFrontierResult
impl UnwindSafe for IteratedDominanceFrontierResult
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> 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