pub struct ControlFlowAnalysis {
pub dominators: HashMap<NodeId, Option<NodeId>>,
pub dominated: HashMap<NodeId, HashSet<NodeId>>,
pub loops: Vec<LoopInfo>,
pub conditionals: Vec<ConditionalInfo>,
pub stats: ControlFlowStats,
}Expand description
Control flow analysis for identifying loops, conditions, and dominance relationships
Fields§
§dominators: HashMap<NodeId, Option<NodeId>>Dominator tree: each node maps to its immediate dominator
dominated: HashMap<NodeId, HashSet<NodeId>>Dominated nodes: each node maps to the set of nodes it dominates
loops: Vec<LoopInfo>Loop information
conditionals: Vec<ConditionalInfo>Conditional blocks
stats: ControlFlowStatsStatistics about the control flow
Implementations§
Source§impl ControlFlowAnalysis
impl ControlFlowAnalysis
Sourcepub fn analyze(graph: &ComputationGraph) -> JitResult<Self>
pub fn analyze(graph: &ComputationGraph) -> JitResult<Self>
Analyze a computation graph for control flow patterns
Sourcepub fn is_in_loop(&self, node: NodeId) -> bool
pub fn is_in_loop(&self, node: NodeId) -> bool
Check if a node is inside a loop
Sourcepub fn is_in_conditional(&self, node: NodeId) -> bool
pub fn is_in_conditional(&self, node: NodeId) -> bool
Check if a node is inside a conditional branch
Sourcepub fn containing_loop(&self, node: NodeId) -> Option<&LoopInfo>
pub fn containing_loop(&self, node: NodeId) -> Option<&LoopInfo>
Get the loop that contains a given node
Sourcepub fn containing_conditional(&self, node: NodeId) -> Option<&ConditionalInfo>
pub fn containing_conditional(&self, node: NodeId) -> Option<&ConditionalInfo>
Get the conditional that contains a given node
Trait Implementations§
Source§impl Clone for ControlFlowAnalysis
impl Clone for ControlFlowAnalysis
Source§fn clone(&self) -> ControlFlowAnalysis
fn clone(&self) -> ControlFlowAnalysis
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 ControlFlowAnalysis
impl Debug for ControlFlowAnalysis
Auto Trait Implementations§
impl Freeze for ControlFlowAnalysis
impl RefUnwindSafe for ControlFlowAnalysis
impl Send for ControlFlowAnalysis
impl Sync for ControlFlowAnalysis
impl Unpin for ControlFlowAnalysis
impl UnsafeUnpin for ControlFlowAnalysis
impl UnwindSafe for ControlFlowAnalysis
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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