Commit b22fcf9f authored by Thibaud Michaud's avatar Thibaud Michaud Committed by V8 LUCI CQ

Revert "[regalloc] add hint for operands in gap moves."

This reverts commit c14b3e4d.

Reason for revert: https://crbug.com/1335195

Original change's description:
> [regalloc] add hint for operands in gap moves.
>
> To eliminate unnecessary move instructions from register to fixed register. We check the fixed register hint for operands in move gaps
> when building LiveRanges. If a to_operand has a hint_operand (with fixed register), then set the hint_operand for from_operand too. This can avoid the register allocator ignore hint information about fixed register.
>
> Bug: v8:12909
> Change-Id: I17f9afa484ee08de8ac1ab42945caba2c362fc9e
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3669019
> Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
> Commit-Queue: Jialu Zhang <jialu.zhang@intel.com>
> Cr-Commit-Position: refs/heads/main@{#80844}

Bug: v8:12909
Change-Id: Iedba9244a75074e448c5e85880cc202866b91e71
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3702335
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#81126}
parent 066d0233
......@@ -220,13 +220,6 @@ bool UsePosition::HintRegister(int* register_code) const {
UNREACHABLE();
}
InstructionOperand* UsePosition::GetHintOperand() const {
if (HintTypeField::decode(flags_) == UsePositionHintType::kOperand) {
return reinterpret_cast<InstructionOperand*>(hint_);
}
return nullptr;
}
UsePositionHintType UsePosition::HintTypeForOperand(
const InstructionOperand& op) {
switch (op.kind()) {
......@@ -2321,20 +2314,6 @@ void LiveRangeBuilder::ProcessInstructions(const InstructionBlock* block,
cur->Eliminate();
continue;
}
// Check if to_operand already has a hint_operand(with fixed
// register), if true, set the hint_operand for from_operand to
// avoid this important hint information be ignored by register
// allocator.
int hint_reg = kUnassignedRegister;
UsePosition* hint_pos = to_range->FirstHintPosition(&hint_reg);
if (hint_pos != nullptr) {
DCHECK_NE(hint_reg, kUnassignedRegister);
InstructionOperand* hint_operand = hint_pos->GetHintOperand();
if (hint_operand->IsAnyLocationOperand()) {
hint = hint_operand;
hint_type = UsePosition::HintTypeForOperand(*hint_operand);
}
}
}
} else {
Define(curr_position, &to, spill_mode);
......
......@@ -502,7 +502,6 @@ class V8_EXPORT_PRIVATE UsePosition final
bool IsResolved() const {
return hint_type() != UsePositionHintType::kUnresolved;
}
InstructionOperand* GetHintOperand() const;
static UsePositionHintType HintTypeForOperand(const InstructionOperand& op);
private:
......
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