Lines Matching refs:node
8 #include "src/compiler/node-properties.h"
26 Reduction BranchElimination::Reduce(Node* node) {
27 switch (node->opcode()) {
31 return ReduceMerge(node);
33 return ReduceLoop(node);
35 return ReduceBranch(node);
37 return ReduceIf(node, false);
39 return ReduceIf(node, true);
41 return ReduceStart(node);
43 if (node->op()->ControlOutputCount() > 0) {
44 return ReduceOtherControl(node);
52 Reduction BranchElimination::ReduceBranch(Node* node) {
53 Node* condition = node->InputAt(0);
54 Node* control_input = NodeProperties::GetControlInput(node, 0);
61 for (Node* const use : node->uses()) {
76 return TakeConditionsFromFirstControl(node);
80 Reduction BranchElimination::ReduceIf(Node* node, bool is_true_branch) {
82 Node* branch = NodeProperties::GetControlInput(node, 0);
88 DCHECK(node_conditions_.Get(node) == nullptr);
91 Node* condition = branch->InputAt(0);
93 node, from_branch->AddCondition(zone_, condition, is_true_branch));
97 Reduction BranchElimination::ReduceLoop(Node* node) {
101 return TakeConditionsFromFirstControl(node);
105 Reduction BranchElimination::ReduceMerge(Node* node) {
108 for (int i = 0; i < node->InputCount(); i++) {
109 if (node_conditions_.Get(node->InputAt(i)) == nullptr) {
110 DCHECK(node_conditions_.Get(node) == nullptr);
115 const ControlPathConditions* first = node_conditions_.Get(node->InputAt(0));
121 for (int i = 1; i < node->InputCount(); i++) {
122 conditions->Merge(*(node_conditions_.Get(node->InputAt(i))));
125 return UpdateConditions(node, conditions);
129 Reduction BranchElimination::ReduceStart(Node* node) {
130 return UpdateConditions(node, ControlPathConditions::Empty(zone_));
135 BranchElimination::PathConditionsForControlNodes::Get(Node* node) {
136 if (static_cast<size_t>(node->id()) < info_for_node_.size()) {
137 return info_for_node_[node->id()];
144 Node* node, const ControlPathConditions* conditions) {
145 size_t index = static_cast<size_t>(node->id());
153 Reduction BranchElimination::ReduceOtherControl(Node* node) {
154 DCHECK_EQ(1, node->op()->ControlInputCount());
155 return TakeConditionsFromFirstControl(node);
159 Reduction BranchElimination::TakeConditionsFromFirstControl(Node* node) {
163 node_conditions_.Get(NodeProperties::GetControlInput(node, 0));
164 return UpdateConditions(node, from_input);
169 Node* node, const ControlPathConditions* conditions) {
170 const ControlPathConditions* original = node_conditions_.Get(node);
171 // Only signal that the node has Changed if the condition information has
175 node_conditions_.Set(node, conditions);
176 return Changed(node);
223 Node* condition,
238 Node* condition) const {