Lines Matching refs:Node
6 #include "src/compiler/node-properties.h"
17 void ControlEquivalence::Run(Node* exit) {
29 void ControlEquivalence::VisitPre(Node* node) {
30 TRACE("CEQ: Pre-visit of #%d:%s\n", node->id(), node->op()->mnemonic());
33 SetNumber(node, NewDFSNumber());
34 TRACE(" Assigned DFS number is %zu\n", GetNumber(node));
38 void ControlEquivalence::VisitMid(Node* node, DFSDirection direction) {
39 TRACE("CEQ: Mid-visit of #%d:%s\n", node->id(), node->op()->mnemonic());
40 BracketList& blist = GetBracketList(node);
42 // Remove brackets pointing to this node [line:19].
43 BracketListDelete(blist, node, direction);
48 VisitBackedge(node, graph_->end(), kInputDirection);
59 // Assign equivalence class to node.
60 SetClass(node, recent->recent_class);
61 TRACE(" Assigned class number is %zu\n", GetClass(node));
65 void ControlEquivalence::VisitPost(Node* node, Node* parent_node,
67 TRACE("CEQ: Post-visit of #%d:%s\n", node->id(), node->op()->mnemonic());
68 BracketList& blist = GetBracketList(node);
70 // Remove brackets pointing to this node [line:19].
71 BracketListDelete(blist, node, direction);
81 void ControlEquivalence::VisitBackedge(Node* from, Node* to,
92 void ControlEquivalence::RunUndirectedDFS(Node* exit) {
99 Node* node = entry.node;
102 if (entry.input != node->input_edges().end()) {
104 Node* input = edge.to();
113 VisitBackedge(node, input, kInputDirection);
117 DFSPush(stack, input, node, kInputDirection);
123 if (entry.use != node->use_edges().end()) {
126 VisitMid(node, kInputDirection);
132 if (entry.use != node->use_edges().end()) {
134 Node* use = edge.from();
143 VisitBackedge(node, use, kUseDirection);
147 DFSPush(stack, use, node, kUseDirection);
153 if (entry.input != node->input_edges().end()) {
156 VisitMid(node, kUseDirection);
161 // Pop node from stack when done with all inputs and uses.
162 DCHECK(entry.input == node->input_edges().end());
163 DCHECK(entry.use == node->use_edges().end());
164 DFSPop(stack, node);
165 VisitPost(node, entry.parent_node, entry.direction);
169 void ControlEquivalence::DetermineParticipationEnqueue(ZoneQueue<Node*>& queue,
170 Node* node) {
171 if (!GetData(node)->participates) {
172 GetData(node)->participates = true;
173 queue.push(node);
178 void ControlEquivalence::DetermineParticipation(Node* exit) {
179 ZoneQueue<Node*> queue(zone_);
182 Node* node = queue.front();
184 int max = NodeProperties::PastControlIndex(node);
185 for (int i = NodeProperties::FirstControlIndex(node); i < max; i++) {
186 DetermineParticipationEnqueue(queue, node->InputAt(i));
192 void ControlEquivalence::DFSPush(DFSStack& stack, Node* node, Node* from,
194 DCHECK(GetData(node)->participates);
195 DCHECK(!GetData(node)->visited);
196 GetData(node)->on_stack = true;
197 Node::InputEdges::iterator input = node->input_edges().begin();
198 Node::UseEdges::iterator use = node->use_edges().begin();
199 stack.push({dir, input, use, from, node});
203 void ControlEquivalence::DFSPop(DFSStack& stack, Node* node) {
204 DCHECK_EQ(stack.top().node, node);
205 GetData(node)->on_stack = false;
206 GetData(node)->visited = true;
211 void ControlEquivalence::BracketListDelete(BracketList& blist, Node* to,