Commit 0e6ba966 authored by Toon Verwaest's avatar Toon Verwaest Committed by V8 LUCI CQ

[maglev] Drop the explicit AllocationStage

Now that we have block-lists this isn't strictly necessary anymore.
As a side-effect, AllocateRegister for results now can't use registers
used as inputs anymore either. We could explicitly use
FreeSomeRegister without blocklist in that case, but this CL doesn't
do that yet.

Bug: v8:7700
Change-Id: If4aef1face138e528dc4f8da674326805e4af67c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3749194
Auto-Submit: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81592}
parent 0a8f45e8
This diff is collapsed.
......@@ -92,7 +92,7 @@ class RegisterFrameState {
void clear_blocked() { blocked_ = kEmptyRegList; }
compiler::AllocatedOperand ChooseInputRegister(ValueNode* node);
compiler::InstructionOperand TryAllocateRegister(ValueNode* node);
compiler::AllocatedOperand AllocateRegister(ValueNode* node);
private:
ValueNode* values_[RegisterT::kNumRegisters];
......@@ -107,8 +107,6 @@ class StraightForwardRegisterAllocator {
~StraightForwardRegisterAllocator();
private:
enum class AllocationStage { kAtStart, kAtEnd };
RegisterFrameState<Register> general_registers_;
RegisterFrameState<DoubleRegister> double_registers_;
......@@ -167,30 +165,39 @@ class StraightForwardRegisterAllocator {
void FreeRegistersUsedBy(ValueNode* node);
template <typename RegisterT>
RegisterT FreeSomeRegister(RegisterFrameState<RegisterT>& registers,
AllocationStage stage);
Register FreeSomeGeneralRegister(AllocationStage stage);
DoubleRegister FreeSomeDoubleRegister(AllocationStage stage);
RegisterT FreeUnblockedRegister();
template <typename RegisterT>
RegisterT PickRegisterToFree(RegListBase<RegisterT> reserved);
template <typename RegisterT>
RegisterFrameState<RegisterT>& GetRegisterFrameState() {
if constexpr (std::is_same<RegisterT, Register>::value) {
return general_registers_;
} else {
return double_registers_;
}
}
template <typename RegisterT>
void DropRegisterValueAtEnd(RegisterT reg);
template <typename RegisterT>
void EnsureFreeRegisterAtEnd();
compiler::AllocatedOperand AllocateRegisterAtEnd(ValueNode* node);
template <typename RegisterT>
void DropRegisterValue(RegisterFrameState<RegisterT>& registers,
RegisterT reg, AllocationStage stage);
void DropRegisterValue(Register reg, AllocationStage stage);
void DropRegisterValue(DoubleRegister reg, AllocationStage stage);
RegisterT reg);
void DropRegisterValue(Register reg);
void DropRegisterValue(DoubleRegister reg);
compiler::AllocatedOperand AllocateRegister(ValueNode* node,
AllocationStage stage);
compiler::AllocatedOperand AllocateRegister(ValueNode* node);
template <typename RegisterT>
compiler::AllocatedOperand ForceAllocate(
RegisterFrameState<RegisterT>& registers, RegisterT reg, ValueNode* node,
AllocationStage stage);
compiler::AllocatedOperand ForceAllocate(Register reg, ValueNode* node,
AllocationStage stage);
compiler::AllocatedOperand ForceAllocate(DoubleRegister reg, ValueNode* node,
AllocationStage stage);
compiler::AllocatedOperand ForceAllocate(const Input& input, ValueNode* node,
AllocationStage stage);
RegisterFrameState<RegisterT>& registers, RegisterT reg, ValueNode* node);
compiler::AllocatedOperand ForceAllocate(Register reg, ValueNode* node);
compiler::AllocatedOperand ForceAllocate(DoubleRegister reg, ValueNode* node);
compiler::AllocatedOperand ForceAllocate(const Input& input, ValueNode* node);
template <typename Function>
void ForEachMergePointRegisterState(
......
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