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

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

Issue 1718223002: [turbofan] don't take hints from deferred blocks (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 | 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 02ba1f17c24c640d6865f5c5805ec267b85828a6..fec5d1b027bcf59a3555ceb8b96730fe7084a6da 100644
--- a/src/compiler/register-allocator.cc
+++ b/src/compiler/register-allocator.cc
@@ -2197,8 +2197,22 @@ void LiveRangeBuilder::ProcessPhis(const InstructionBlock* block,
int phi_vreg = phi->virtual_register();
live->Remove(phi_vreg);
InstructionOperand* hint = nullptr;
- Instruction* instr = GetLastInstruction(
- code(), code()->InstructionBlockAt(block->predecessors()[0]));
+ const InstructionBlock::Predecessors& predecessors = block->predecessors();
+ const InstructionBlock* predecessor_block =
+ code()->InstructionBlockAt(predecessors[0]);
+ const Instruction* instr = GetLastInstruction(code(), predecessor_block);
+ if (predecessor_block->IsDeferred()) {
+ // "Prefer the hint from the first non-deferred predecessor, if any.
+ for (size_t i = 1; i < predecessors.size(); ++i) {
+ predecessor_block = code()->InstructionBlockAt(predecessors[i]);
+ if (!predecessor_block->IsDeferred()) {
+ instr = GetLastInstruction(code(), predecessor_block);
+ break;
+ }
+ }
+ }
+ DCHECK_NOT_NULL(instr);
+
for (MoveOperands* move : *instr->GetParallelMove(Instruction::END)) {
InstructionOperand& to = move->destination();
if (to.IsUnallocated() &&
« 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