| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/compiler/loop-variable-optimizer.h" | 5 #include "src/compiler/loop-variable-optimizer.h" |
| 6 | 6 |
| 7 #include "src/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
| 8 #include "src/compiler/graph.h" | 8 #include "src/compiler/graph.h" |
| 9 #include "src/compiler/node-marker.h" | 9 #include "src/compiler/node-marker.h" |
| 10 #include "src/compiler/node-properties.h" | 10 #include "src/compiler/node-properties.h" |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 return VisitLoopExit(node); | 214 return VisitLoopExit(node); |
| 215 default: | 215 default: |
| 216 return VisitOtherControl(node); | 216 return VisitOtherControl(node); |
| 217 } | 217 } |
| 218 } | 218 } |
| 219 | 219 |
| 220 void LoopVariableOptimizer::VisitMerge(Node* node) { | 220 void LoopVariableOptimizer::VisitMerge(Node* node) { |
| 221 // Merge the limits of all incoming edges. | 221 // Merge the limits of all incoming edges. |
| 222 VariableLimits* merged = limits_[node->InputAt(0)->id()]->Copy(zone()); | 222 VariableLimits* merged = limits_[node->InputAt(0)->id()]->Copy(zone()); |
| 223 for (int i = 1; i < node->InputCount(); i++) { | 223 for (int i = 1; i < node->InputCount(); i++) { |
| 224 merged->Merge(limits_[node->InputAt(0)->id()]); | 224 merged->Merge(limits_[node->InputAt(i)->id()]); |
| 225 } | 225 } |
| 226 limits_[node->id()] = merged; | 226 limits_[node->id()] = merged; |
| 227 } | 227 } |
| 228 | 228 |
| 229 void LoopVariableOptimizer::VisitLoop(Node* node) { | 229 void LoopVariableOptimizer::VisitLoop(Node* node) { |
| 230 DetectInductionVariables(node); | 230 DetectInductionVariables(node); |
| 231 // Conservatively take the limits from the loop entry here. | 231 // Conservatively take the limits from the loop entry here. |
| 232 return TakeConditionsFromFirstControl(node); | 232 return TakeConditionsFromFirstControl(node); |
| 233 } | 233 } |
| 234 | 234 |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 backedge_value, backedge_control); | 395 backedge_value, backedge_control); |
| 396 induction_var->phi()->ReplaceInput(1, rename); | 396 induction_var->phi()->ReplaceInput(1, rename); |
| 397 } | 397 } |
| 398 } | 398 } |
| 399 } | 399 } |
| 400 } | 400 } |
| 401 | 401 |
| 402 } // namespace compiler | 402 } // namespace compiler |
| 403 } // namespace internal | 403 } // namespace internal |
| 404 } // namespace v8 | 404 } // namespace v8 |
| OLD | NEW |