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

Side by Side Diff: lib/compiler/implementation/ssa/optimize.dart

Issue 10704229: Fix loop-invariant code motion. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « lib/compiler/implementation/ssa/nodes.dart ('k') | tests/language/loop_hoist_test.dart » ('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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 interface OptimizationPhase { 5 interface OptimizationPhase {
6 String get name(); 6 String get name();
7 void visitGraph(HGraph graph); 7 void visitGraph(HGraph graph);
8 } 8 }
9 9
10 class SsaOptimizerTask extends CompilerTask { 10 class SsaOptimizerTask extends CompilerTask {
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 } 879 }
880 } 880 }
881 881
882 // If the inputs are loop invariant, we can move the 882 // If the inputs are loop invariant, we can move the
883 // instruction from the current block to the pre-header block. 883 // instruction from the current block to the pre-header block.
884 if (loopInvariantInputs) { 884 if (loopInvariantInputs) {
885 block.detach(instruction); 885 block.detach(instruction);
886 preheader.moveAtExit(instruction); 886 preheader.moveAtExit(instruction);
887 } 887 }
888 } 888 }
889 int oldChangesFlags = changesFlags;
890 changesFlags |= instruction.getChangesFlags();
891 if (oldChangesFlags != changesFlags) {
892 dependsFlags = HInstruction.computeDependsOnFlags(changesFlags);
893 }
889 instruction = next; 894 instruction = next;
890 } 895 }
891 } 896 }
892 897
893 bool isInputDefinedAfterDominator(HInstruction input, 898 bool isInputDefinedAfterDominator(HInstruction input,
894 HBasicBlock dominator) { 899 HBasicBlock dominator) {
895 return input.block.id > dominator.id; 900 return input.block.id > dominator.id;
896 } 901 }
897 902
898 void visitBasicBlock(HBasicBlock block, ValueSet values) { 903 void visitBasicBlock(HBasicBlock block, ValueSet values) {
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
1301 // this type for the field is still a strong signal 1306 // this type for the field is still a strong signal
1302 // indicating the expected type of the field. 1307 // indicating the expected type of the field.
1303 field.propagatedType = type; 1308 field.propagatedType = type;
1304 } else { 1309 } else {
1305 // If there are no invoked setters we know the type of 1310 // If there are no invoked setters we know the type of
1306 // this field for sure. 1311 // this field for sure.
1307 field.guaranteedType = type; 1312 field.guaranteedType = type;
1308 } 1313 }
1309 } 1314 }
1310 } 1315 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/nodes.dart ('k') | tests/language/loop_hoist_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698