Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(454)

Side by Side Diff: src/compiler/loop-variable-optimizer.cc

Issue 2222953003: [turbofan] Fix silly bug in loop variable analysis. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/compiler/regress-loop-variable-if.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/compiler/regress-loop-variable-if.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698