Commit 5fc253a8 authored by mtrofin's avatar mtrofin Committed by Commit bot

[turbofan] Include individual deferred block ranges in splintering.

While we may have consecutive deferred blocks, they may be entered
from other blocks that are not predecessors of the first block. Same
for the last block and exiting. So the total set of live ranges within
the given set of blocks is the union of the individual in and out live
sets.

This is a performance bug, not a functional bug.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#30564}
parent 296db16e
...@@ -113,8 +113,17 @@ void SplinterRangesInDeferredBlocks(RegisterAllocationData *data) { ...@@ -113,8 +113,17 @@ void SplinterRangesInDeferredBlocks(RegisterAllocationData *data) {
static_cast<int>(code->instructions().size())); static_cast<int>(code->instructions().size()));
const BitVector *in_set = in_sets[block->rpo_number().ToInt()]; const BitVector *in_set = in_sets[block->rpo_number().ToInt()];
BitVector ranges_to_splinter(*in_set, zone);
InstructionBlock *last = code->InstructionBlockAt(last_deferred); InstructionBlock *last = code->InstructionBlockAt(last_deferred);
const BitVector *out_set = LiveRangeBuilder::ComputeLiveOut(last, data); for (int deferred_id = block->rpo_number().ToInt();
deferred_id <= last->rpo_number().ToInt(); ++deferred_id) {
const BitVector *ins = in_sets[deferred_id];
ranges_to_splinter.Union(*ins);
const BitVector *outs = LiveRangeBuilder::ComputeLiveOut(
code->InstructionBlockAt(RpoNumber::FromInt(deferred_id)), data);
ranges_to_splinter.Union(*outs);
}
int last_index = last->last_instruction_index(); int last_index = last->last_instruction_index();
if (code->InstructionAt(last_index)->opcode() == if (code->InstructionAt(last_index)->opcode() ==
ArchOpcode::kArchDeoptimize) { ArchOpcode::kArchDeoptimize) {
...@@ -122,8 +131,6 @@ void SplinterRangesInDeferredBlocks(RegisterAllocationData *data) { ...@@ -122,8 +131,6 @@ void SplinterRangesInDeferredBlocks(RegisterAllocationData *data) {
} }
last_cut = LifetimePosition::GapFromInstructionIndex(last_index); last_cut = LifetimePosition::GapFromInstructionIndex(last_index);
BitVector ranges_to_splinter(*in_set, zone);
ranges_to_splinter.Union(*out_set);
BitVector::Iterator iterator(&ranges_to_splinter); BitVector::Iterator iterator(&ranges_to_splinter);
while (!iterator.Done()) { while (!iterator.Done()) {
......
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