Lines Matching defs:node
10 #include "src/compiler/node-properties.h"
32 Reduction BranchElimination::Reduce(Node* node) {
33 switch (node->opcode()) {
38 return ReduceDeoptimizeConditional(node);
40 return ReduceMerge(node);
42 return ReduceLoop(node);
44 return ReduceBranch(node);
46 return ReduceIf(node, false);
48 return ReduceIf(node, true);
51 return ReduceTrapConditional(node);
53 return ReduceStart(node);
55 if (node->op()->ControlOutputCount() > 0) {
56 return ReduceOtherControl(node);
133 Reduction BranchElimination::ReduceBranch(Node* node) {
134 Node* condition = node->InputAt(0);
135 Node* control_input = NodeProperties::GetControlInput(node, 0);
142 for (Node* const use : node->uses()) {
156 SimplifyBranchCondition(node);
159 for (Node* const use : node->uses()) {
162 return TakeConditionsFromFirstControl(node);
183 bool BranchElimination::TryPullTrapIntoMerge(Node* node) {
184 DCHECK(node->opcode() == IrOpcode::kTrapIf ||
185 node->opcode() == IrOpcode::kTrapUnless);
186 Node* merge = NodeProperties::GetControlInput(node);
188 Node* condition = NodeProperties::GetValueInput(node, 0);
189 Node* effect_input = NodeProperties::GetEffectInput(node);
195 bool trapping_condition = node->opcode() == IrOpcode::kTrapIf;
210 Node* trap_clone = graph()->NewNode(node->op(), 3, inputs);
213 trap_clone, source_positions_->GetSourcePosition(node));
224 ReplaceWithValue(node, dead(), dead(), merge);
225 node->Kill();
231 Reduction BranchElimination::ReduceTrapConditional(Node* node) {
232 DCHECK(node->opcode() == IrOpcode::kTrapIf ||
233 node->opcode() == IrOpcode::kTrapUnless);
234 bool trapping_condition = node->opcode() == IrOpcode::kTrapIf;
235 Node* condition = node->InputAt(0);
236 Node* control_input = NodeProperties::GetControlInput(node, 0);
245 TryPullTrapIntoMerge(node)) {
282 node->ReplaceInput(NodeProperties::FirstControlIndex(node),
284 ReplaceWithValue(node, dead(), dead(), dead());
285 ReplaceWithValue(other_if_branch, node, node, node);
289 return Changed(node);
295 ReplaceWithValue(node, dead(), dead(), dead());
296 Node* effect = NodeProperties::GetEffectInput(node);
297 Node* control = graph()->NewNode(common()->Throw(), effect, node);
300 return Changed(node);
306 return UpdateConditions(node, from_input, condition, node,
310 Reduction BranchElimination::ReduceDeoptimizeConditional(Node* node) {
311 DCHECK(node->opcode() == IrOpcode::kDeoptimizeIf ||
312 node->opcode() == IrOpcode::kDeoptimizeUnless);
313 bool condition_is_true = node->opcode() == IrOpcode::kDeoptimizeUnless;
314 DeoptimizeParameters p = DeoptimizeParametersOf(node->op());
315 Node* condition = NodeProperties::GetValueInput(node, 0);
316 Node* frame_state = NodeProperties::GetValueInput(node, 1);
317 Node* effect = NodeProperties::GetEffectInput(node);
318 Node* control = NodeProperties::GetControlInput(node);
332 // We don't update the conditions here, because we're replacing {node}
333 // with the {control} node that already contains the right information.
334 ReplaceWithValue(node, dead(), effect, control);
344 return UpdateConditions(node, conditions, condition, node, condition_is_true,
348 Reduction BranchElimination::ReduceIf(Node* node, bool is_true_branch) {
350 Node* branch = NodeProperties::GetControlInput(node, 0);
359 return UpdateConditions(node, from_branch, condition, branch, is_true_branch,
363 Reduction BranchElimination::ReduceLoop(Node* node) {
367 return TakeConditionsFromFirstControl(node);
370 Reduction BranchElimination::ReduceMerge(Node* node) {
373 Node::Inputs inputs = node->inputs();
395 return UpdateConditions(node, conditions);
398 Reduction BranchElimination::ReduceStart(Node* node) {
399 return UpdateConditions(node, ControlPathConditions(zone_));
402 Reduction BranchElimination::ReduceOtherControl(Node* node) {
403 DCHECK_EQ(1, node->op()->ControlInputCount());
404 return TakeConditionsFromFirstControl(node);
407 Reduction BranchElimination::TakeConditionsFromFirstControl(Node* node) {
410 Node* input = NodeProperties::GetControlInput(node, 0);
412 return UpdateConditions(node, node_conditions_.Get(input));
416 Node* node, ControlPathConditions conditions) {
417 // Only signal that the node has Changed if the condition information has
419 bool reduced_changed = reduced_.Set(node, true);
420 bool node_conditions_changed = node_conditions_.Set(node, conditions);
422 return Changed(node);
428 Node* node, ControlPathConditions prev_conditions, Node* current_condition,
430 // The control path for the node is the path obtained by appending the
437 ControlPathConditions original = node_conditions_.Get(node);
441 return UpdateConditions(node, prev_conditions);