Commit 888c0c2d authored by mtrofin's avatar mtrofin Committed by Commit bot

[turbofan] move down parallel moves.

The regression the bug tracks (see the bug link) appears to
be due to identical gap moves in the predecessors of a block
not being moved to the common successor. This CR fixes one
reason that is happening.

BUG=chromium:549262
LOG=n

Review URL: https://codereview.chromium.org/1523393003

Cr-Commit-Position: refs/heads/master@{#32874}
parent 3cc09fb4
...@@ -91,11 +91,12 @@ MoveOptimizer::MoveOptimizer(Zone* local_zone, InstructionSequence* code) ...@@ -91,11 +91,12 @@ MoveOptimizer::MoveOptimizer(Zone* local_zone, InstructionSequence* code)
void MoveOptimizer::Run() { void MoveOptimizer::Run() {
for (auto* block : code()->instruction_blocks()) { for (InstructionBlock* block : code()->instruction_blocks()) {
CompressBlock(block); CompressBlock(block);
} }
for (auto block : code()->instruction_blocks()) { for (InstructionBlock* block : code()->instruction_blocks()) {
if (block->PredecessorCount() <= 1) continue; if (block->PredecessorCount() <= 1) continue;
if (!block->IsDeferred()) {
bool has_only_deferred = true; bool has_only_deferred = true;
for (RpoNumber pred_id : block->predecessors()) { for (RpoNumber pred_id : block->predecessors()) {
if (!code()->InstructionBlockAt(pred_id)->IsDeferred()) { if (!code()->InstructionBlockAt(pred_id)->IsDeferred()) {
...@@ -103,10 +104,12 @@ void MoveOptimizer::Run() { ...@@ -103,10 +104,12 @@ void MoveOptimizer::Run() {
break; break;
} }
} }
// This would pull down common moves. If the moves occur in deferred blocks, // This would pull down common moves. If the moves occur in deferred
// and the closest common successor is not deferred, we lose the // blocks, and the closest common successor is not deferred, we lose the
// optimization of just spilling/filling in deferred blocks. // optimization of just spilling/filling in deferred blocks, when the
// current block is not deferred.
if (has_only_deferred) continue; if (has_only_deferred) continue;
}
OptimizeMerge(block); OptimizeMerge(block);
} }
for (auto gap : to_finalize_) { for (auto gap : to_finalize_) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment