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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 183303002: Fix bug in load elimination with multiple phis. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/language/vm/load_to_load_forwarding_vm_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.cc
===================================================================
--- runtime/vm/flow_graph_optimizer.cc (revision 33112)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -5624,7 +5624,6 @@
result->id());
}
}
-
phi_moves->CreateOutgoingMove(block->PredecessorAt(j),
result->id(),
place->id());
@@ -5770,8 +5769,6 @@
// Loads that are locally redundant will be replaced as we go through
// instructions.
void ComputeInitialSets() {
- BitVector* forwarded_loads = new BitVector(aliased_set_->max_place_id());
-
for (BlockIterator block_it = graph_->reverse_postorder_iterator();
!block_it.Done();
block_it.Advance()) {
@@ -5930,12 +5927,6 @@
(*out_values)[place_id] = defn;
}
- PhiPlaceMoves::MovesList phi_moves =
- aliased_set_->phi_moves()->GetOutgoingMoves(block);
- if (phi_moves != NULL) {
- PerformPhiMoves(phi_moves, gen, forwarded_loads);
- }
-
exposed_values_[preorder_number] = exposed_values;
out_values_[preorder_number] = out_values;
}
@@ -5972,6 +5963,7 @@
void ComputeOutSets() {
BitVector* temp = new BitVector(aliased_set_->max_place_id());
BitVector* forwarded_loads = new BitVector(aliased_set_->max_place_id());
+ BitVector* temp_out = new BitVector(aliased_set_->max_place_id());
bool changed = true;
while (changed) {
@@ -6000,7 +5992,17 @@
BlockEntryInstr* pred = block->PredecessorAt(i);
BitVector* pred_out = out_[pred->preorder_number()];
if (pred_out != NULL) {
Vyacheslav Egorov (Chromium) 2014/02/27 16:25:09 I would write it slightly differently: if (pred_o
Florian Schneider 2014/02/28 13:38:57 Done.
- temp->Intersect(pred_out);
+ PhiPlaceMoves::MovesList phi_moves =
+ aliased_set_->phi_moves()->GetOutgoingMoves(pred);
+ if (phi_moves != NULL) {
+ // If there are phi moves, perform intersection with
+ // a copy of pred_out where the phi moves are applied.
+ temp_out->CopyFrom(pred_out);
+ PerformPhiMoves(phi_moves, temp_out, forwarded_loads);
+ temp->Intersect(temp_out);
+ } else {
+ temp->Intersect(pred_out);
+ }
}
}
}
@@ -6012,12 +6014,6 @@
temp->RemoveAll(block_kill);
temp->AddAll(block_gen);
- PhiPlaceMoves::MovesList phi_moves =
- aliased_set_->phi_moves()->GetOutgoingMoves(block);
- if (phi_moves != NULL) {
- PerformPhiMoves(phi_moves, temp, forwarded_loads);
- }
-
if ((block_out == NULL) || !block_out->Equals(*temp)) {
if (block_out == NULL) {
block_out = out_[preorder_number] =
« no previous file with comments | « no previous file | tests/language/vm/load_to_load_forwarding_vm_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698