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

Side by Side Diff: runtime/vm/flow_graph_optimizer.cc

Issue 12391060: In LoadOptimizer::EmitPhis check for environment uses of phis. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 | « no previous file | tests/language/store_to_load_forwarding_phis_vm_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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 #include "vm/flow_graph_optimizer.h" 5 #include "vm/flow_graph_optimizer.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/cha.h" 8 #include "vm/cha.h"
9 #include "vm/flow_graph_builder.h" 9 #include "vm/flow_graph_builder.h"
10 #include "vm/flow_graph_compiler.h" 10 #include "vm/flow_graph_compiler.h"
(...skipping 3363 matching lines...) Expand 10 before | Expand all | Expand 10 after
3374 3374
3375 return true; 3375 return true;
3376 } 3376 }
3377 3377
3378 // Phis have not yet been inserted into the graph but they have uses of 3378 // Phis have not yet been inserted into the graph but they have uses of
3379 // their inputs. Insert the non-redundant ones and clear the input uses 3379 // their inputs. Insert the non-redundant ones and clear the input uses
3380 // of the redundant ones. 3380 // of the redundant ones.
3381 void EmitPhis() { 3381 void EmitPhis() {
3382 for (intptr_t i = 0; i < phis_.length(); i++) { 3382 for (intptr_t i = 0; i < phis_.length(); i++) {
3383 PhiInstr* phi = phis_[i]; 3383 PhiInstr* phi = phis_[i];
3384 if ((phi->input_use_list() != NULL) && !EliminateRedundantPhi(phi)) { 3384 if (phi->HasUses() && !EliminateRedundantPhi(phi)) {
3385 phi->mark_alive(); 3385 phi->mark_alive();
3386 phi->block()->InsertPhi(phi); 3386 phi->block()->InsertPhi(phi);
3387 } else { 3387 } else {
3388 for (intptr_t j = phi->InputCount() - 1; j >= 0; --j) { 3388 for (intptr_t j = phi->InputCount() - 1; j >= 0; --j) {
3389 phi->InputAt(j)->RemoveFromUseList(); 3389 phi->InputAt(j)->RemoveFromUseList();
3390 } 3390 }
3391 } 3391 }
3392 } 3392 }
3393 } 3393 }
3394 3394
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after
4368 4368
4369 if (FLAG_trace_constant_propagation) { 4369 if (FLAG_trace_constant_propagation) {
4370 OS::Print("\n==== After constant propagation ====\n"); 4370 OS::Print("\n==== After constant propagation ====\n");
4371 FlowGraphPrinter printer(*graph_); 4371 FlowGraphPrinter printer(*graph_);
4372 printer.PrintBlocks(); 4372 printer.PrintBlocks();
4373 } 4373 }
4374 } 4374 }
4375 4375
4376 4376
4377 } // namespace dart 4377 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/language/store_to_load_forwarding_phis_vm_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698