Lines Matching defs:loop
42 // Represents a loop in the tree of loops, including the header nodes,
75 // Return the innermost nested loop, if any, that contains {node}.
82 // Check if the {loop} contains the {node}, either directly or by containing
83 // a nested loop that contains {node}.
84 bool Contains(const Loop* loop, Node* node) {
86 if (c == loop) return true;
97 for (const Loop& loop : all_loops_) {
98 if (loop.children().empty()) {
99 inner_loops.push_back(&loop);
105 // Return the unique loop number for a given loop. Loop numbers start at {1}.
106 int LoopNum(const Loop* loop) const {
107 return 1 + static_cast<int>(loop - &all_loops_[0]);
110 // Return a range which can iterate over the header nodes of {loop}.
111 NodeRange HeaderNodes(const Loop* loop) {
112 return NodeRange(&loop_nodes_[0] + loop->header_start_,
113 &loop_nodes_[0] + loop->body_start_);
116 // Return the header control node for a loop.
117 Node* HeaderNode(const Loop* loop);
119 // Return a range which can iterate over the body nodes of {loop}.
120 NodeRange BodyNodes(const Loop* loop) {
121 return NodeRange(&loop_nodes_[0] + loop->body_start_,
122 &loop_nodes_[0] + loop->exits_start_);
125 // Return a range which can iterate over the body nodes of {loop}.
126 NodeRange ExitNodes(const Loop* loop) {
127 return NodeRange(&loop_nodes_[0] + loop->exits_start_,
128 &loop_nodes_[0] + loop->exits_end_);
131 // Return a range which can iterate over the nodes of {loop}.
132 NodeRange LoopNodes(const Loop* loop) {
133 return NodeRange(&loop_nodes_[0] + loop->header_start_,
134 &loop_nodes_[0] + loop->exits_end_);
137 // Return the node that represents the control, i.e. the loop node itself.
138 Node* GetLoopControl(const Loop* loop) {
139 // TODO(turbofan): make the loop control node always first?
140 for (Node* node : HeaderNodes(loop)) {
176 // Build a loop tree for the entire graph.
180 static bool HasMarkedExits(LoopTree* loop_tree_, const LoopTree::Loop* loop);
183 // Find all nodes in the loop headed by {loop_header} if it contains no nested
185 // Assumption: *if* this loop has no nested loops, all exits from the loop are
188 // 1) the loop size (in graph nodes) exceeds {max_size},
189 // 2) {calls_are_large} and a function call is found in the loop, excluding
191 // 3) a nested loop is found in the loop.