Lines Matching defs:node
10 #include "src/compiler/node-marker.h"
26 // out-of-line data associated with each node.
32 // Represents the result of trying to reduce a node in the graph.
49 // A reducer can reduce or simplify a given node based on its operator and
61 // Try to reduce a node if possible.
62 Reduction Reduce(Node* node, ObserveNodeManager* observe_node_manager);
69 // Helper functions for subclasses to produce reductions for a node.
71 static Reduction Replace(Node* node) { return Reduction(node); }
72 static Reduction Changed(Node* node) { return Reduction(node); }
75 virtual Reduction Reduce(Node* node) = 0;
88 // Replace {node} with {replacement}.
89 virtual void Replace(Node* node, Node* replacement) = 0;
90 // Revisit the {node} again later.
91 virtual void Revisit(Node* node) = 0;
92 // Replace value uses of {node} with {value} and effect uses of {node} with
93 // {effect}. If {effect == nullptr}, then use the effect input to {node}.
94 // All control uses will be relaxed assuming {node} cannot throw.
95 virtual void ReplaceWithValue(Node* node, Node* value, Node* effect,
102 // Helper functions for subclasses to produce reductions for a node.
103 static Reduction Replace(Node* node) { return Reducer::Replace(node); }
106 void Replace(Node* node, Node* replacement) {
108 editor_->Replace(node, replacement);
110 void Revisit(Node* node) {
112 editor_->Revisit(node);
114 void ReplaceWithValue(Node* node, Node* value, Node* effect = nullptr,
117 editor_->ReplaceWithValue(node, value, effect, control);
120 // Relax the effects of {node} by immediately replacing effect and control
121 // uses of {node} with the effect and control input to {node}.
122 // TODO(turbofan): replace the effect input to {node} with {graph->start()}.
123 void RelaxEffectsAndControls(Node* node) {
124 ReplaceWithValue(node, node, nullptr, nullptr);
127 // Relax the control uses of {node} by immediately replacing them with the
128 // control input to {node}.
129 void RelaxControls(Node* node) {
130 ReplaceWithValue(node, node, node, nullptr);
138 // Performs an iterative reduction of a node graph.
154 // Reduce a single node.
162 Node* node;
166 // Reduce a single node.
168 // Reduce the node on top of the stack.
171 // Replace {node} with {replacement}.
172 void Replace(Node* node, Node* replacement) final;
174 // Replace value uses of {node} with {value} and effect uses of {node} with
175 // {effect}. If {effect == nullptr}, then use the effect input to {node}. All
176 // control uses will be relaxed assuming {node} cannot throw.
177 void ReplaceWithValue(Node* node, Node* value, Node* effect,
180 // Replace all uses of {node} with {replacement} if the id of {replacement} is
181 // less than or equal to {max_id}. Otherwise, replace all uses of {node} whose
183 void Replace(Node* node, Node* replacement, NodeId max_id);
187 void Push(Node* node);
190 bool Recurse(Node* node);
191 void Revisit(Node* node) final;