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

Unified Diff: runtime/vm/flow_graph_allocator.cc

Issue 10827116: Mark phi-operands live-in for a predecessor if they are not defined by it. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_allocator.cc
diff --git a/runtime/vm/flow_graph_allocator.cc b/runtime/vm/flow_graph_allocator.cc
index 0b5998270b467542e4f806d47a111637419b14da..73cda77f58748d43ae337014b161f4c1a4da1674 100644
--- a/runtime/vm/flow_graph_allocator.cc
+++ b/runtime/vm/flow_graph_allocator.cc
@@ -127,6 +127,19 @@ void FlowGraphAllocator::ComputeInitialSets() {
if (phi == NULL) continue;
kill->Add(phi->ssa_temp_index());
live_in->Remove(phi->ssa_temp_index());
+
+ // If phi-operand is not defined by a predecessor it must be marked
+ // live-in for a predecessor.
+ for (intptr_t k = 0; k < phi->InputCount(); k++) {
+ Value* val = phi->InputAt(k);
+ if (val->IsUse()) {
+ BlockEntryInstr* pred = block->PredecessorAt(k);
+ const intptr_t use = val->AsUse()->definition()->ssa_temp_index();
+ if (!kill_[pred->postorder_number()]->Contains(use)) {
+ live_in_[pred->postorder_number()]->Add(use);
+ }
+ }
+ }
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698