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,22 +91,25 @@ MoveOptimizer::MoveOptimizer(Zone* local_zone, InstructionSequence* code)
void MoveOptimizer::Run() {
for (auto* block : code()->instruction_blocks()) {
for (InstructionBlock* block : code()->instruction_blocks()) {
CompressBlock(block);
}
for (auto block : code()->instruction_blocks()) {
for (InstructionBlock* block : code()->instruction_blocks()) {
if (block->PredecessorCount() <= 1) continue;
bool has_only_deferred = true;
for (RpoNumber pred_id : block->predecessors()) {
if (!code()->InstructionBlockAt(pred_id)->IsDeferred()) {
has_only_deferred = false;
break;
if (!block->IsDeferred()) {
bool has_only_deferred = true;
for (RpoNumber pred_id : block->predecessors()) {
if (!code()->InstructionBlockAt(pred_id)->IsDeferred()) {
has_only_deferred = false;
break;
}
}
// This would pull down common moves. If the moves occur in deferred
// blocks, and the closest common successor is not deferred, we lose the
// optimization of just spilling/filling in deferred blocks, when the
// current block is not deferred.
if (has_only_deferred) continue;
}
// This would pull down common moves. If the moves occur in deferred blocks,
// and the closest common successor is not deferred, we lose the
// optimization of just spilling/filling in deferred blocks.
if (has_only_deferred) continue;
OptimizeMerge(block);
}
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