Commit 8f855e97 authored by Toon Verwaest's avatar Toon Verwaest Committed by V8 LUCI CQ

[maglev] Block more allocated regs

- block regs that already contained the value
- clear the blocklists (including double) in more places
- check that a ForceAllocated reg isn't blocked yet (when allocated
  at start)

Bug: v8:7700
Change-Id: I17b58ff23e0558f962a5d798a39ebb7d9b0ae634
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3716470Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Auto-Submit: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81273}
parent 47a2a5a0
......@@ -338,6 +338,8 @@ void StraightForwardRegisterAllocator::AllocateRegisters() {
PrintLiveRegs();
printing_visitor_->os() << std::endl;
}
general_registers_.clear_blocked();
double_registers_.clear_blocked();
}
VerifyRegisterState();
......@@ -493,6 +495,7 @@ void StraightForwardRegisterAllocator::AllocateNode(Node* node) {
general_registers_.AddToFree(node->temporaries());
general_registers_.clear_blocked();
double_registers_.clear_blocked();
VerifyRegisterState();
}
......@@ -728,6 +731,7 @@ void StraightForwardRegisterAllocator::AllocateControlNode(ControlNode* node,
general_registers_.AddToFree(node->temporaries());
general_registers_.clear_blocked();
double_registers_.clear_blocked();
VerifyRegisterState();
}
......@@ -1121,6 +1125,8 @@ template <typename RegisterT>
compiler::AllocatedOperand StraightForwardRegisterAllocator::ForceAllocate(
RegisterFrameState<RegisterT>& registers, RegisterT reg, ValueNode* node,
AllocationStage stage) {
DCHECK_IMPLIES(stage == AllocationStage::kAtStart,
!registers.is_blocked(reg));
if (FLAG_trace_maglev_regalloc) {
printing_visitor_->os()
<< " forcing " << reg << " to "
......@@ -1130,6 +1136,7 @@ compiler::AllocatedOperand StraightForwardRegisterAllocator::ForceAllocate(
// If it's already free, remove it from the free list.
registers.RemoveFromFree(reg);
} else if (registers.GetValue(reg) == node) {
registers.block(reg);
return compiler::AllocatedOperand(compiler::LocationOperand::REGISTER,
node->GetMachineRepresentation(),
reg.code());
......
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