Revert "[TurboProp] Add PendingOperand for use by fast register allocator."

This reverts commit ab7e89f123.

Reason for revert: Breaks GCC build - https://ci.chromium.org/p/v8/builders/ci/V8%20Linux64%20gcc%20-%20debug/8442?

Original change's description:
> [TurboProp] Add PendingOperand for use by fast register allocator.
> 
> Adds a pending operand type for use with the fast register allocator.
> These operands chain together multiple operands together, enabling
> the allocator to keep track of multiple pending operands, then
> replace them all with the allocated operand in one go.
> 
> BUG=v8:9684
> 
> Change-Id: I5d8150f3f26549a747a2e89e32e31135e89dff9c
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2292302
> Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#69019}

TBR=rmcilroy@chromium.org,tebbi@chromium.org

Change-Id: If689956f873f05bcd920090143769a0d4686d804
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:9684
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2315992
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69023}
This commit is contained in:
Maya Lekova 2020-07-23 12:18:09 +00:00 committed by Commit Bot
parent b7e33d0424
commit c3e651219d
4 changed files with 1 additions and 61 deletions

View File

@ -4,7 +4,6 @@
#include "src/compiler/backend/instruction.h"
#include <cstddef>
#include <iomanip>
#include "src/codegen/interface-descriptors.h"
@ -170,8 +169,6 @@ std::ostream& operator<<(std::ostream& os, const InstructionOperand& op) {
return os << "[immediate:" << imm.indexed_value() << "]";
}
}
case InstructionOperand::PENDING:
return os << "[pending: " << PendingOperand::cast(op).next() << "]";
case InstructionOperand::ALLOCATED: {
LocationOperand allocated = LocationOperand::cast(op);
if (op.IsStackSlot()) {
@ -299,9 +296,6 @@ Instruction::Instruction(InstructionCode opcode)
block_(nullptr) {
parallel_moves_[0] = nullptr;
parallel_moves_[1] = nullptr;
// PendingOperands are required to be 8 byte aligned.
STATIC_ASSERT(offsetof(Instruction, operands_) % 8 == 0);
}
Instruction::Instruction(InstructionCode opcode, size_t output_count,

View File

@ -33,7 +33,7 @@ namespace compiler {
class Schedule;
class SourcePositionTable;
class V8_EXPORT_PRIVATE alignas(8) InstructionOperand {
class V8_EXPORT_PRIVATE InstructionOperand {
public:
static const int kInvalidVirtualRegister = -1;
@ -42,7 +42,6 @@ class V8_EXPORT_PRIVATE alignas(8) InstructionOperand {
UNALLOCATED,
CONSTANT,
IMMEDIATE,
PENDING,
// Location operand kinds.
ALLOCATED,
FIRST_LOCATION_OPERAND_KIND = ALLOCATED
@ -68,10 +67,6 @@ class V8_EXPORT_PRIVATE alignas(8) InstructionOperand {
// embedded directly in instructions, e.g. small integers and on some
// platforms Objects.
INSTRUCTION_OPERAND_PREDICATE(Immediate, IMMEDIATE)
// PendingOperands are pending allocation during register allocation and
// shouldn't be seen elsewhere. They chain together multiple operators that
// will be replaced together with the same value when finalized.
INSTRUCTION_OPERAND_PREDICATE(Pending, PENDING)
// AllocatedOperands are registers or stack slots that are assigned by the
// register allocator and are always associated with a virtual register.
INSTRUCTION_OPERAND_PREDICATE(Allocated, ALLOCATED)
@ -104,10 +99,6 @@ class V8_EXPORT_PRIVATE alignas(8) InstructionOperand {
}
bool Equals(const InstructionOperand& that) const {
if (IsPending()) {
// Pending operands are only equal if they are the same operand.
return this == &that;
}
return this->value_ == that.value_;
}
@ -116,15 +107,10 @@ class V8_EXPORT_PRIVATE alignas(8) InstructionOperand {
}
bool EqualsCanonicalized(const InstructionOperand& that) const {
if (IsPending()) {
// Pending operands can't be canonicalized, so just compare for equality.
return Equals(that);
}
return this->GetCanonicalizedValue() == that.GetCanonicalizedValue();
}
bool CompareCanonicalized(const InstructionOperand& that) const {
DCHECK(!IsPending());
return this->GetCanonicalizedValue() < that.GetCanonicalizedValue();
}
@ -418,44 +404,6 @@ class ImmediateOperand : public InstructionOperand {
using ValueField = base::BitField64<int32_t, 32, 32>;
};
class PendingOperand : public InstructionOperand {
public:
PendingOperand() : InstructionOperand(PENDING) {}
explicit PendingOperand(PendingOperand* next_operand) : PendingOperand() {
set_next(next_operand);
}
void set_next(PendingOperand* next) {
DCHECK_NULL(this->next());
uintptr_t shifted_value =
reinterpret_cast<uintptr_t>(next) >> kPointerShift;
DCHECK_EQ(reinterpret_cast<uintptr_t>(next),
shifted_value << kPointerShift);
value_ |= NextOperandField::encode(static_cast<uint64_t>(shifted_value));
}
PendingOperand* next() const {
uintptr_t shifted_value =
static_cast<uint64_t>(NextOperandField::decode(value_));
return reinterpret_cast<PendingOperand*>(shifted_value << kPointerShift);
}
static PendingOperand* New(Zone* zone, PendingOperand* previous_operand) {
return InstructionOperand::New(zone, PendingOperand(previous_operand));
}
INSTRUCTION_OPERAND_CASTS(PendingOperand, PENDING)
private:
// Operands are uint64_t values and so are aligned to 8 byte boundaries,
// therefore we can shift off the bottom three zeros without losing data.
static const uint64_t kPointerShift = 3;
STATIC_ASSERT(alignof(InstructionOperand) >= (1 << kPointerShift));
STATIC_ASSERT(KindField::kSize == 3);
using NextOperandField = base::BitField64<uint64_t, 3, 61>;
};
class LocationOperand : public InstructionOperand {
public:
enum LocationKind { REGISTER, STACK_SLOT };

View File

@ -284,7 +284,6 @@ UsePositionHintType UsePosition::HintTypeForOperand(
DCHECK(op.IsStackSlot() || op.IsFPStackSlot());
return UsePositionHintType::kNone;
}
case InstructionOperand::PENDING:
case InstructionOperand::INVALID:
break;
}

View File

@ -1211,7 +1211,6 @@ std::ostream& operator<<(std::ostream& os, const InstructionOperandAsJSON& o) {
<< MachineReprToString(allocated->representation()) << "\"";
break;
}
case InstructionOperand::PENDING:
case InstructionOperand::INVALID:
UNREACHABLE();
}