Struct bytecode::loop_analysis::FatLoop
source · pub struct FatLoop {
pub invariants: BTreeMap<CodeOffset, (AttrId, Exp)>,
pub val_targets: BTreeSet<TempIndex>,
pub mut_targets: BTreeMap<TempIndex, bool>,
pub back_edges: BTreeSet<CodeOffset>,
}
Expand description
A fat-loop captures the information of one or more natural loops that share the same loop header. This shared header is called the header of the fat-loop.
Conceptually, every back edge defines a unique natural loop and different back edges may points to the same loop header (e.g., when there are two “continue” statements in the loop body).
However, since these natural loops share the same loop header, they share the same loop invariants too and the fat-loop targets (i.e., variables that may be changed in any sub-loop) is the union of loop targets per each natural loop that share the header.
Fields§
§invariants: BTreeMap<CodeOffset, (AttrId, Exp)>
§val_targets: BTreeSet<TempIndex>
§mut_targets: BTreeMap<TempIndex, bool>
§back_edges: BTreeSet<CodeOffset>