Home | History | Annotate | Download | only in compiler

Lines Matching refs:node

7 #include "src/compiler/node-properties.h"
18 Reduction RedundancyElimination::Reduce(Node* node) {
19 if (node_checks_.Get(node)) return NoChange();
20 switch (node->opcode()) {
41 return ReduceCheckNode(node);
46 return TryReuseBoundsCheckForFirstInput(node);
48 return ReduceEffectPhi(node);
52 return ReduceStart(node);
54 return ReduceOtherNode(node);
78 if (this_head->node != that_head->node) return false;
116 Node* node) const {
117 Check* head = new (zone->New(sizeof(Check))) Check(node, head_);
124 bool IsCompatibleCheck(Node const* a, Node const* b) {
128 // CheckInternalizedString(node) implies CheckString(node)
141 Node* RedundancyElimination::EffectPathChecks::LookupCheck(Node* node) const {
143 if (IsCompatibleCheck(check->node, node)) {
144 DCHECK(!check->node->IsDead());
145 return check->node;
151 Node* RedundancyElimination::EffectPathChecks::LookupBoundsCheckFor(
152 Node* node) const {
154 if (check->node->opcode() == IrOpcode::kCheckBounds &&
155 check->node->InputAt(0) == node) {
156 return check->node;
163 RedundancyElimination::PathChecksForEffectNodes::Get(Node* node) const {
164 size_t const id = node->id();
170 Node* node, EffectPathChecks const* checks) {
171 size_t const id = node->id();
176 Reduction RedundancyElimination::ReduceCheckNode(Node* node) {
177 Node* const effect = NodeProperties::GetEffectInput(node);
183 if (Node* check = checks->LookupCheck(node)) {
184 ReplaceWithValue(node, check);
189 return UpdateChecks(node, checks->AddCheck(zone(), node));
192 Reduction RedundancyElimination::TryReuseBoundsCheckForFirstInput(Node* node) {
193 DCHECK(node->opcode() == IrOpcode::kSpeculativeNumberAdd ||
194 node->opcode() == IrOpcode::kSpeculativeNumberSubtract);
196 DCHECK_EQ(1, node->op()->EffectInputCount());
197 DCHECK_EQ(1, node->op()->EffectOutputCount());
199 Node* const effect = NodeProperties::GetEffectInput(node);
206 Node* left = node->InputAt(0);
207 Node* right = node->InputAt(1);
210 if (Node* bounds_check = checks->LookupBoundsCheckFor(left)) {
214 node->ReplaceInput(0, bounds_check);
219 return UpdateChecks(node, checks);
222 Reduction RedundancyElimination::ReduceEffectPhi(Node* node) {
223 Node* const control = NodeProperties::GetControlInput(node);
228 return TakeChecksFromFirstEffect(node);
233 int const input_count = node->op()->EffectInputCount();
235 Node* const effect = NodeProperties::GetEffectInput(node, i);
242 zone(), node_checks_.Get(NodeProperties::GetEffectInput(node, 0)));
244 Node* const input = NodeProperties::GetEffectInput(node, i);
247 return UpdateChecks(node, checks);
250 Reduction RedundancyElimination::ReduceStart(Node* node) {
251 return UpdateChecks(node, EffectPathChecks::Empty(zone()));
254 Reduction RedundancyElimination::ReduceOtherNode(Node* node) {
255 if (node->op()->EffectInputCount() == 1) {
256 if (node->op()->EffectOutputCount() == 1) {
257 return TakeChecksFromFirstEffect(node);
263 DCHECK_EQ(0, node->op()->EffectInputCount());
264 DCHECK_EQ(0, node->op()->EffectOutputCount());
268 Reduction RedundancyElimination::TakeChecksFromFirstEffect(Node* node) {
269 DCHECK_EQ(1, node->op()->EffectOutputCount());
270 Node* const effect = NodeProperties::GetEffectInput(node);
277 return UpdateChecks(node, checks);
280 Reduction RedundancyElimination::UpdateChecks(Node* node,
282 EffectPathChecks const* original = node_checks_.Get(node);
283 // Only signal that the {node} has Changed, if the information about {checks}
287 node_checks_.Set(node, checks);
288 return Changed(node);