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

Unified Diff: src/compiler/register-allocator.cc

Issue 623313003: [turbofan] map vregs early (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-selector-impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/register-allocator.cc
diff --git a/src/compiler/register-allocator.cc b/src/compiler/register-allocator.cc
index ff196eaa910a1204e83f3f366fdf27543b05498b..fbaf4fa4e7e941d962855f9f53657cd85ddc22d8 100644
--- a/src/compiler/register-allocator.cc
+++ b/src/compiler/register-allocator.cc
@@ -548,10 +548,9 @@ BitVector* RegisterAllocator::ComputeLiveOut(BasicBlock* block) {
Node* phi = *j;
if (phi->opcode() != IrOpcode::kPhi) continue;
Node* input = phi->InputAt(static_cast<int>(index));
- live_out->Add(input->id());
+ live_out->Add(code()->GetVirtualRegister(input));
}
}
-
return live_out;
}
@@ -1066,7 +1065,8 @@ void RegisterAllocator::ResolvePhis(BasicBlock* block) {
UnallocatedOperand* phi_operand =
new (code_zone()) UnallocatedOperand(UnallocatedOperand::NONE);
- phi_operand->set_virtual_register(phi->id());
+ int phi_vreg = code()->GetVirtualRegister(phi);
+ phi_operand->set_virtual_register(phi_vreg);
size_t j = 0;
Node::Inputs inputs = phi->inputs();
@@ -1077,7 +1077,7 @@ void RegisterAllocator::ResolvePhis(BasicBlock* block) {
if (j >= block->PredecessorCount()) continue;
UnallocatedOperand* operand =
new (code_zone()) UnallocatedOperand(UnallocatedOperand::ANY);
- operand->set_virtual_register(op->id());
+ operand->set_virtual_register(code()->GetVirtualRegister(op));
BasicBlock* cur_block = block->PredecessorAt(j);
// The gap move must be added without any special processing as in
// the AddConstraintsGapMove.
@@ -1089,7 +1089,7 @@ void RegisterAllocator::ResolvePhis(BasicBlock* block) {
USE(branch);
}
- LiveRange* live_range = LiveRangeFor(phi->id());
+ LiveRange* live_range = LiveRangeFor(phi_vreg);
BlockStartInstruction* block_start = code()->GetBlockStart(block);
block_start->GetOrCreateParallelMove(GapInstruction::START, code_zone())
->AddMove(phi_operand, live_range->GetSpillOperand(), code_zone());
@@ -1298,7 +1298,8 @@ void RegisterAllocator::BuildLiveRanges() {
// The live range interval already ends at the first instruction of the
// block.
- live->Remove(phi->id());
+ int phi_vreg = code()->GetVirtualRegister(phi);
+ live->Remove(phi_vreg);
InstructionOperand* hint = NULL;
InstructionOperand* phi_operand = NULL;
@@ -1310,7 +1311,7 @@ void RegisterAllocator::BuildLiveRanges() {
for (int j = 0; j < move->move_operands()->length(); ++j) {
InstructionOperand* to = move->move_operands()->at(j).destination();
if (to->IsUnallocated() &&
- UnallocatedOperand::cast(to)->virtual_register() == phi->id()) {
+ UnallocatedOperand::cast(to)->virtual_register() == phi_vreg) {
hint = move->move_operands()->at(j).source();
phi_operand = to;
break;
« no previous file with comments | « src/compiler/instruction-selector-impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698