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

Unified Diff: src/compiler/instruction-selector.cc

Issue 664683002: [turbofan] decouple register allocation from schedule and graph (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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 | « src/compiler/instruction.cc ('k') | src/compiler/register-allocator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction-selector.cc
diff --git a/src/compiler/instruction-selector.cc b/src/compiler/instruction-selector.cc
index bd3bfd73c9a7969a9dca3412945bb486d507b27d..157509310ba844c974dbe1aa8b35f96f7f79f1e0 100644
--- a/src/compiler/instruction-selector.cc
+++ b/src/compiler/instruction-selector.cc
@@ -853,8 +853,17 @@ void InstructionSelector::VisitParameter(Node* node) {
void InstructionSelector::VisitPhi(Node* node) {
// TODO(bmeurer): Emit a PhiInstruction here.
- for (InputIter i = node->inputs().begin(); i != node->inputs().end(); ++i) {
- MarkAsUsed(*i);
+ PhiInstruction* phi = new (instruction_zone())
+ PhiInstruction(instruction_zone(), sequence()->GetVirtualRegister(node));
+ sequence()->InstructionBlockAt(current_block_->GetRpoNumber())->AddPhi(phi);
+ Node::Inputs inputs = node->inputs();
+ size_t j = 0;
+ for (Node::Inputs::iterator iter(inputs.begin()); iter != inputs.end();
+ ++iter, ++j) {
+ MarkAsUsed(*iter);
+ // TODO(mstarzinger): Use a ValueInputIterator instead.
+ if (j >= current_block_->PredecessorCount()) continue;
+ phi->operands().push_back(sequence()->GetVirtualRegister(*iter));
}
}
« no previous file with comments | « src/compiler/instruction.cc ('k') | src/compiler/register-allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698