Commit 232b0982 authored by dcarney's avatar dcarney Committed by Commit bot

[turbofan] make register hinting explicit

- instead of committing operands early to resolve hints, hold the hint register data on the UsePosition
- allow hints to be rolled back efficiently as needed by GreedyAllocator
- some small drive by fixes

BUG=

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

Cr-Commit-Position: refs/heads/master@{#28075}
parent 77e37028
......@@ -750,12 +750,7 @@ void GraphC1Visualizer::PrintLiveRange(LiveRange* range, const char* type) {
} else {
parent_index = range->id();
}
InstructionOperand* op = range->FirstHint();
int hint_index = -1;
if (op != NULL && op->IsUnallocated()) {
hint_index = UnallocatedOperand::cast(op)->virtual_register();
}
os_ << " " << parent_index << " " << hint_index;
os_ << " " << parent_index;
for (auto interval = range->first_interval(); interval != nullptr;
interval = interval->next()) {
os_ << " [" << interval->start().value() << ", "
......
......@@ -255,8 +255,8 @@ class PipelineData {
info()->isolate(), instruction_zone(), instruction_blocks);
}
void InitializeLiveRangeBuilder(const RegisterConfiguration* config,
const char* debug_name) {
void InitializeRegisterAllocationData(const RegisterConfiguration* config,
const char* debug_name) {
DCHECK(frame_ == nullptr);
DCHECK(register_allocation_data_ == nullptr);
frame_ = new (instruction_zone()) Frame();
......@@ -744,7 +744,7 @@ struct BuildLiveRangesPhase {
static const char* phase_name() { return "build live ranges"; }
void Run(PipelineData* data, Zone* temp_zone) {
LiveRangeBuilder builder(data->register_allocation_data());
LiveRangeBuilder builder(data->register_allocation_data(), temp_zone);
builder.BuildLiveRanges();
}
};
......@@ -1263,7 +1263,7 @@ void Pipeline::AllocateRegisters(const RegisterConfiguration* config,
debug_name = GetDebugName(data->info());
#endif
data->InitializeLiveRangeBuilder(config, debug_name.get());
data->InitializeRegisterAllocationData(config, debug_name.get());
if (info()->is_osr()) {
OsrHelper osr_helper(info());
osr_helper.SetupFrame(data->frame());
......
This diff is collapsed.
This diff is collapsed.
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