Commit 193cfbf0 authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[compiler,cleanup] Remove some redundant stuff

In particular: initial values of local ArchOpcode variables that
get overwritten anyways. Creating these variables uninitialized makes
that obvious.

Change-Id: Ia205b5397c60769a46bf28ed60b299ac652f4b28
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2470557
Auto-Submit: Georg Neis <neis@chromium.org>
Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70526}
parent 718fbb89
......@@ -666,7 +666,6 @@ void InstructionSelector::VisitStore(Node* node) {
case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE();
return;
}
ExternalReferenceMatcher m(base);
......@@ -2191,7 +2190,7 @@ void InstructionSelector::VisitWord32AtomicLoad(Node* node) {
ArmOperandGenerator g(this);
Node* base = node->InputAt(0);
Node* index = node->InputAt(1);
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
switch (load_rep.representation()) {
case MachineRepresentation::kWord8:
opcode =
......@@ -2217,7 +2216,7 @@ void InstructionSelector::VisitWord32AtomicStore(Node* node) {
Node* base = node->InputAt(0);
Node* index = node->InputAt(1);
Node* value = node->InputAt(2);
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
switch (rep) {
case MachineRepresentation::kWord8:
opcode = kWord32AtomicStoreWord8;
......@@ -2247,7 +2246,7 @@ void InstructionSelector::VisitWord32AtomicExchange(Node* node) {
Node* base = node->InputAt(0);
Node* index = node->InputAt(1);
Node* value = node->InputAt(2);
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
MachineType type = AtomicOpType(node->op());
if (type == MachineType::Int8()) {
opcode = kWord32AtomicExchangeInt8;
......@@ -2261,7 +2260,6 @@ void InstructionSelector::VisitWord32AtomicExchange(Node* node) {
opcode = kWord32AtomicExchangeWord32;
} else {
UNREACHABLE();
return;
}
AddressingMode addressing_mode = kMode_Offset_RR;
......@@ -2283,7 +2281,7 @@ void InstructionSelector::VisitWord32AtomicCompareExchange(Node* node) {
Node* index = node->InputAt(1);
Node* old_value = node->InputAt(2);
Node* new_value = node->InputAt(3);
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
MachineType type = AtomicOpType(node->op());
if (type == MachineType::Int8()) {
opcode = kWord32AtomicCompareExchangeInt8;
......@@ -2297,7 +2295,6 @@ void InstructionSelector::VisitWord32AtomicCompareExchange(Node* node) {
opcode = kWord32AtomicCompareExchangeWord32;
} else {
UNREACHABLE();
return;
}
AddressingMode addressing_mode = kMode_Offset_RR;
......@@ -2322,7 +2319,7 @@ void InstructionSelector::VisitWord32AtomicBinaryOperation(
Node* base = node->InputAt(0);
Node* index = node->InputAt(1);
Node* value = node->InputAt(2);
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
MachineType type = AtomicOpType(node->op());
if (type == MachineType::Int8()) {
opcode = int8_op;
......@@ -2336,7 +2333,6 @@ void InstructionSelector::VisitWord32AtomicBinaryOperation(
opcode = word32_op;
} else {
UNREACHABLE();
return;
}
AddressingMode addressing_mode = kMode_Offset_RR;
......
......@@ -1771,7 +1771,6 @@ void InstructionSelector::VisitChangeInt32ToInt64(Node* node) {
break;
default:
UNREACHABLE();
return;
}
EmitLoad(this, value, opcode, immediate_mode, rep, node);
return;
......@@ -2974,7 +2973,7 @@ void InstructionSelector::VisitMemoryBarrier(Node* node) {
void InstructionSelector::VisitWord32AtomicLoad(Node* node) {
LoadRepresentation load_rep = LoadRepresentationOf(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
switch (load_rep.representation()) {
case MachineRepresentation::kWord8:
opcode =
......@@ -2995,7 +2994,7 @@ void InstructionSelector::VisitWord32AtomicLoad(Node* node) {
void InstructionSelector::VisitWord64AtomicLoad(Node* node) {
LoadRepresentation load_rep = LoadRepresentationOf(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
switch (load_rep.representation()) {
case MachineRepresentation::kWord8:
opcode = kArm64Word64AtomicLoadUint8;
......@@ -3017,7 +3016,7 @@ void InstructionSelector::VisitWord64AtomicLoad(Node* node) {
void InstructionSelector::VisitWord32AtomicStore(Node* node) {
MachineRepresentation rep = AtomicStoreRepresentationOf(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
switch (rep) {
case MachineRepresentation::kWord8:
opcode = kWord32AtomicStoreWord8;
......@@ -3036,7 +3035,7 @@ void InstructionSelector::VisitWord32AtomicStore(Node* node) {
void InstructionSelector::VisitWord64AtomicStore(Node* node) {
MachineRepresentation rep = AtomicStoreRepresentationOf(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
switch (rep) {
case MachineRepresentation::kWord8:
opcode = kArm64Word64AtomicStoreWord8;
......@@ -3057,7 +3056,7 @@ void InstructionSelector::VisitWord64AtomicStore(Node* node) {
}
void InstructionSelector::VisitWord32AtomicExchange(Node* node) {
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
MachineType type = AtomicOpType(node->op());
if (type == MachineType::Int8()) {
opcode = kWord32AtomicExchangeInt8;
......@@ -3071,13 +3070,12 @@ void InstructionSelector::VisitWord32AtomicExchange(Node* node) {
opcode = kWord32AtomicExchangeWord32;
} else {
UNREACHABLE();
return;
}
VisitAtomicExchange(this, node, opcode);
}
void InstructionSelector::VisitWord64AtomicExchange(Node* node) {
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
MachineType type = AtomicOpType(node->op());
if (type == MachineType::Uint8()) {
opcode = kArm64Word64AtomicExchangeUint8;
......@@ -3089,13 +3087,12 @@ void InstructionSelector::VisitWord64AtomicExchange(Node* node) {
opcode = kArm64Word64AtomicExchangeUint64;
} else {
UNREACHABLE();
return;
}
VisitAtomicExchange(this, node, opcode);
}
void InstructionSelector::VisitWord32AtomicCompareExchange(Node* node) {
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
MachineType type = AtomicOpType(node->op());
if (type == MachineType::Int8()) {
opcode = kWord32AtomicCompareExchangeInt8;
......@@ -3109,13 +3106,12 @@ void InstructionSelector::VisitWord32AtomicCompareExchange(Node* node) {
opcode = kWord32AtomicCompareExchangeWord32;
} else {
UNREACHABLE();
return;
}
VisitAtomicCompareExchange(this, node, opcode);
}
void InstructionSelector::VisitWord64AtomicCompareExchange(Node* node) {
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
MachineType type = AtomicOpType(node->op());
if (type == MachineType::Uint8()) {
opcode = kArm64Word64AtomicCompareExchangeUint8;
......@@ -3127,7 +3123,6 @@ void InstructionSelector::VisitWord64AtomicCompareExchange(Node* node) {
opcode = kArm64Word64AtomicCompareExchangeUint64;
} else {
UNREACHABLE();
return;
}
VisitAtomicCompareExchange(this, node, opcode);
}
......@@ -3135,7 +3130,7 @@ void InstructionSelector::VisitWord64AtomicCompareExchange(Node* node) {
void InstructionSelector::VisitWord32AtomicBinaryOperation(
Node* node, ArchOpcode int8_op, ArchOpcode uint8_op, ArchOpcode int16_op,
ArchOpcode uint16_op, ArchOpcode word32_op) {
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
MachineType type = AtomicOpType(node->op());
if (type == MachineType::Int8()) {
opcode = int8_op;
......@@ -3149,7 +3144,6 @@ void InstructionSelector::VisitWord32AtomicBinaryOperation(
opcode = word32_op;
} else {
UNREACHABLE();
return;
}
VisitAtomicBinop(this, node, opcode);
}
......@@ -3171,7 +3165,7 @@ VISIT_ATOMIC_BINOP(Xor)
void InstructionSelector::VisitWord64AtomicBinaryOperation(
Node* node, ArchOpcode uint8_op, ArchOpcode uint16_op, ArchOpcode uint32_op,
ArchOpcode uint64_op) {
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
MachineType type = AtomicOpType(node->op());
if (type == MachineType::Uint8()) {
opcode = uint8_op;
......@@ -3183,7 +3177,6 @@ void InstructionSelector::VisitWord64AtomicBinaryOperation(
opcode = uint64_op;
} else {
UNREACHABLE();
return;
}
VisitAtomicBinop(this, node, opcode);
}
......
......@@ -364,7 +364,7 @@ void InstructionSelector::VisitAbortCSAAssert(Node* node) {
void InstructionSelector::VisitLoadTransform(Node* node) {
LoadTransformParameters params = LoadTransformParametersOf(node->op());
InstructionCode opcode = kArchNop;
InstructionCode opcode;
switch (params.transformation) {
case LoadTransformation::kS128Load8Splat:
opcode = kIA32S128Load8Splat;
......@@ -419,7 +419,7 @@ void InstructionSelector::VisitLoadTransform(Node* node) {
void InstructionSelector::VisitLoad(Node* node) {
LoadRepresentation load_rep = LoadRepresentationOf(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
switch (load_rep.representation()) {
case MachineRepresentation::kFloat32:
opcode = kIA32Movss;
......@@ -503,7 +503,7 @@ void InstructionSelector::VisitStore(Node* node) {
code |= MiscField::encode(static_cast<int>(record_write_mode));
Emit(code, 0, nullptr, arraysize(inputs), inputs, temp_count, temps);
} else {
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
switch (rep) {
case MachineRepresentation::kFloat32:
opcode = kIA32Movss;
......@@ -532,7 +532,6 @@ void InstructionSelector::VisitStore(Node* node) {
case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE();
return;
}
InstructionOperand val;
......@@ -1818,7 +1817,7 @@ void InstructionSelector::VisitWord32AtomicLoad(Node* node) {
void InstructionSelector::VisitWord32AtomicStore(Node* node) {
IA32OperandGenerator g(this);
MachineRepresentation rep = AtomicStoreRepresentationOf(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
switch (rep) {
case MachineRepresentation::kWord8:
opcode = kWord32AtomicExchangeInt8;
......@@ -1838,7 +1837,7 @@ void InstructionSelector::VisitWord32AtomicStore(Node* node) {
void InstructionSelector::VisitWord32AtomicExchange(Node* node) {
IA32OperandGenerator g(this);
MachineType type = AtomicOpType(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
if (type == MachineType::Int8()) {
opcode = kWord32AtomicExchangeInt8;
} else if (type == MachineType::Uint8()) {
......@@ -1851,7 +1850,6 @@ void InstructionSelector::VisitWord32AtomicExchange(Node* node) {
opcode = kWord32AtomicExchangeWord32;
} else {
UNREACHABLE();
return;
}
VisitAtomicExchange(this, node, opcode, type.representation());
}
......@@ -1864,7 +1862,7 @@ void InstructionSelector::VisitWord32AtomicCompareExchange(Node* node) {
Node* new_value = node->InputAt(3);
MachineType type = AtomicOpType(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
if (type == MachineType::Int8()) {
opcode = kWord32AtomicCompareExchangeInt8;
} else if (type == MachineType::Uint8()) {
......@@ -1877,7 +1875,6 @@ void InstructionSelector::VisitWord32AtomicCompareExchange(Node* node) {
opcode = kWord32AtomicCompareExchangeWord32;
} else {
UNREACHABLE();
return;
}
AddressingMode addressing_mode;
InstructionOperand new_val_operand =
......@@ -1896,7 +1893,7 @@ void InstructionSelector::VisitWord32AtomicBinaryOperation(
Node* node, ArchOpcode int8_op, ArchOpcode uint8_op, ArchOpcode int16_op,
ArchOpcode uint16_op, ArchOpcode word32_op) {
MachineType type = AtomicOpType(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
if (type == MachineType::Int8()) {
opcode = int8_op;
} else if (type == MachineType::Uint8()) {
......@@ -1909,7 +1906,6 @@ void InstructionSelector::VisitWord32AtomicBinaryOperation(
opcode = word32_op;
} else {
UNREACHABLE();
return;
}
VisitAtomicBinOp(this, node, opcode, type.representation());
}
......
......@@ -604,9 +604,8 @@ size_t InstructionSelector::AddOperandToStateValueDescriptor(
values->PushArgumentsLength();
return 0;
}
case IrOpcode::kObjectState: {
case IrOpcode::kObjectState:
UNREACHABLE();
}
case IrOpcode::kTypedObjectState:
case IrOpcode::kObjectId: {
size_t id = deduplicator->GetObjectId(input);
......@@ -2857,7 +2856,7 @@ void InstructionSelector::VisitCall(Node* node, BasicBlock* handler) {
}
// Select the appropriate opcode based on the call type.
InstructionCode opcode = kArchNop;
InstructionCode opcode;
switch (call_descriptor->kind()) {
case CallDescriptor::kCallAddress: {
int misc_field = static_cast<int>(call_descriptor->ParameterCount());
......@@ -2940,7 +2939,6 @@ void InstructionSelector::VisitTailCall(Node* node) {
break;
default:
UNREACHABLE();
return;
}
int temps_count = GetTempsCountForTailCallFromJSFunction();
for (int i = 0; i < temps_count; i++) {
......@@ -2959,7 +2957,6 @@ void InstructionSelector::VisitTailCall(Node* node) {
break;
default:
UNREACHABLE();
return;
}
}
opcode = EncodeCallDescriptorFlags(opcode, call_descriptor->flags());
......
......@@ -431,7 +431,7 @@ void InstructionSelector::VisitStore(Node* node) {
code |= MiscField::encode(static_cast<int>(record_write_mode));
Emit(code, 0, nullptr, input_count, inputs, temp_count, temps);
} else {
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
switch (rep) {
case MachineRepresentation::kFloat32:
opcode = kMipsSwc1;
......@@ -460,7 +460,6 @@ void InstructionSelector::VisitStore(Node* node) {
case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE();
return;
}
if (g.CanBeImmediate(index, opcode)) {
......@@ -1386,7 +1385,7 @@ void InstructionSelector::VisitUnalignedLoad(Node* node) {
Node* base = node->InputAt(0);
Node* index = node->InputAt(1);
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
switch (load_rep.representation()) {
case MachineRepresentation::kWord8:
opcode = load_rep.IsUnsigned() ? kMipsLbu : kMipsLb;
......@@ -1439,7 +1438,7 @@ void InstructionSelector::VisitUnalignedStore(Node* node) {
UnalignedStoreRepresentation rep = UnalignedStoreRepresentationOf(node->op());
// TODO(mips): I guess this could be done in a better way.
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
switch (rep) {
case MachineRepresentation::kFloat32:
opcode = kMipsUswc1;
......@@ -1887,7 +1886,7 @@ void InstructionSelector::VisitWord32AtomicLoad(Node* node) {
MipsOperandGenerator g(this);
Node* base = node->InputAt(0);
Node* index = node->InputAt(1);
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
switch (load_rep.representation()) {
case MachineRepresentation::kWord8:
opcode =
......@@ -1923,7 +1922,7 @@ void InstructionSelector::VisitWord32AtomicStore(Node* node) {
Node* base = node->InputAt(0);
Node* index = node->InputAt(1);
Node* value = node->InputAt(2);
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
switch (rep) {
case MachineRepresentation::kWord8:
opcode = kWord32AtomicStoreWord8;
......@@ -1957,7 +1956,7 @@ void InstructionSelector::VisitWord32AtomicExchange(Node* node) {
Node* base = node->InputAt(0);
Node* index = node->InputAt(1);
Node* value = node->InputAt(2);
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
MachineType type = AtomicOpType(node->op());
if (type == MachineType::Int8()) {
opcode = kWord32AtomicExchangeInt8;
......@@ -1971,7 +1970,6 @@ void InstructionSelector::VisitWord32AtomicExchange(Node* node) {
opcode = kWord32AtomicExchangeWord32;
} else {
UNREACHABLE();
return;
}
AddressingMode addressing_mode = kMode_MRI;
......@@ -1996,7 +1994,7 @@ void InstructionSelector::VisitWord32AtomicCompareExchange(Node* node) {
Node* index = node->InputAt(1);
Node* old_value = node->InputAt(2);
Node* new_value = node->InputAt(3);
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
MachineType type = AtomicOpType(node->op());
if (type == MachineType::Int8()) {
opcode = kWord32AtomicCompareExchangeInt8;
......@@ -2010,7 +2008,6 @@ void InstructionSelector::VisitWord32AtomicCompareExchange(Node* node) {
opcode = kWord32AtomicCompareExchangeWord32;
} else {
UNREACHABLE();
return;
}
AddressingMode addressing_mode = kMode_MRI;
......@@ -2037,7 +2034,7 @@ void InstructionSelector::VisitWord32AtomicBinaryOperation(
Node* base = node->InputAt(0);
Node* index = node->InputAt(1);
Node* value = node->InputAt(2);
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
MachineType type = AtomicOpType(node->op());
if (type == MachineType::Int8()) {
opcode = int8_op;
......@@ -2051,7 +2048,6 @@ void InstructionSelector::VisitWord32AtomicBinaryOperation(
opcode = word32_op;
} else {
UNREACHABLE();
return;
}
AddressingMode addressing_mode = kMode_MRI;
......
......@@ -504,7 +504,7 @@ void InstructionSelector::VisitStore(Node* node) {
code |= MiscField::encode(static_cast<int>(record_write_mode));
Emit(code, 0, nullptr, input_count, inputs, temp_count, temps);
} else {
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
switch (rep) {
case MachineRepresentation::kFloat32:
opcode = kMips64Swc1;
......@@ -535,7 +535,6 @@ void InstructionSelector::VisitStore(Node* node) {
case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE();
return;
}
if (g.CanBeImmediate(index, opcode)) {
......@@ -1389,7 +1388,6 @@ void InstructionSelector::VisitChangeInt32ToInt64(Node* node) {
break;
default:
UNREACHABLE();
return;
}
EmitLoad(this, value, opcode, node);
} else {
......@@ -1746,7 +1744,7 @@ void InstructionSelector::VisitUnalignedLoad(Node* node) {
Node* base = node->InputAt(0);
Node* index = node->InputAt(1);
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
switch (load_rep.representation()) {
case MachineRepresentation::kFloat32:
opcode = kMips64Ulwc1;
......@@ -1799,7 +1797,7 @@ void InstructionSelector::VisitUnalignedStore(Node* node) {
Node* value = node->InputAt(2);
UnalignedStoreRepresentation rep = UnalignedStoreRepresentationOf(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
switch (rep) {
case MachineRepresentation::kFloat32:
opcode = kMips64Uswc1;
......@@ -2532,7 +2530,7 @@ void InstructionSelector::VisitMemoryBarrier(Node* node) {
void InstructionSelector::VisitWord32AtomicLoad(Node* node) {
LoadRepresentation load_rep = LoadRepresentationOf(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
switch (load_rep.representation()) {
case MachineRepresentation::kWord8:
opcode =
......@@ -2553,7 +2551,7 @@ void InstructionSelector::VisitWord32AtomicLoad(Node* node) {
void InstructionSelector::VisitWord32AtomicStore(Node* node) {
MachineRepresentation rep = AtomicStoreRepresentationOf(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
switch (rep) {
case MachineRepresentation::kWord8:
opcode = kWord32AtomicStoreWord8;
......@@ -2573,7 +2571,7 @@ void InstructionSelector::VisitWord32AtomicStore(Node* node) {
void InstructionSelector::VisitWord64AtomicLoad(Node* node) {
LoadRepresentation load_rep = LoadRepresentationOf(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
switch (load_rep.representation()) {
case MachineRepresentation::kWord8:
opcode = kMips64Word64AtomicLoadUint8;
......@@ -2595,7 +2593,7 @@ void InstructionSelector::VisitWord64AtomicLoad(Node* node) {
void InstructionSelector::VisitWord64AtomicStore(Node* node) {
MachineRepresentation rep = AtomicStoreRepresentationOf(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
switch (rep) {
case MachineRepresentation::kWord8:
opcode = kMips64Word64AtomicStoreWord8;
......@@ -2617,7 +2615,7 @@ void InstructionSelector::VisitWord64AtomicStore(Node* node) {
}
void InstructionSelector::VisitWord32AtomicExchange(Node* node) {
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
MachineType type = AtomicOpType(node->op());
if (type == MachineType::Int8()) {
opcode = kWord32AtomicExchangeInt8;
......@@ -2631,14 +2629,13 @@ void InstructionSelector::VisitWord32AtomicExchange(Node* node) {
opcode = kWord32AtomicExchangeWord32;
} else {
UNREACHABLE();
return;
}
VisitAtomicExchange(this, node, opcode);
}
void InstructionSelector::VisitWord64AtomicExchange(Node* node) {
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
MachineType type = AtomicOpType(node->op());
if (type == MachineType::Uint8()) {
opcode = kMips64Word64AtomicExchangeUint8;
......@@ -2650,13 +2647,12 @@ void InstructionSelector::VisitWord64AtomicExchange(Node* node) {
opcode = kMips64Word64AtomicExchangeUint64;
} else {
UNREACHABLE();
return;
}
VisitAtomicExchange(this, node, opcode);
}
void InstructionSelector::VisitWord32AtomicCompareExchange(Node* node) {
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
MachineType type = AtomicOpType(node->op());
if (type == MachineType::Int8()) {
opcode = kWord32AtomicCompareExchangeInt8;
......@@ -2670,14 +2666,13 @@ void InstructionSelector::VisitWord32AtomicCompareExchange(Node* node) {
opcode = kWord32AtomicCompareExchangeWord32;
} else {
UNREACHABLE();
return;
}
VisitAtomicCompareExchange(this, node, opcode);
}
void InstructionSelector::VisitWord64AtomicCompareExchange(Node* node) {
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
MachineType type = AtomicOpType(node->op());
if (type == MachineType::Uint8()) {
opcode = kMips64Word64AtomicCompareExchangeUint8;
......@@ -2689,14 +2684,13 @@ void InstructionSelector::VisitWord64AtomicCompareExchange(Node* node) {
opcode = kMips64Word64AtomicCompareExchangeUint64;
} else {
UNREACHABLE();
return;
}
VisitAtomicCompareExchange(this, node, opcode);
}
void InstructionSelector::VisitWord32AtomicBinaryOperation(
Node* node, ArchOpcode int8_op, ArchOpcode uint8_op, ArchOpcode int16_op,
ArchOpcode uint16_op, ArchOpcode word32_op) {
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
MachineType type = AtomicOpType(node->op());
if (type == MachineType::Int8()) {
opcode = int8_op;
......@@ -2710,7 +2704,6 @@ void InstructionSelector::VisitWord32AtomicBinaryOperation(
opcode = word32_op;
} else {
UNREACHABLE();
return;
}
VisitAtomicBinop(this, node, opcode);
......@@ -2733,7 +2726,7 @@ VISIT_ATOMIC_BINOP(Xor)
void InstructionSelector::VisitWord64AtomicBinaryOperation(
Node* node, ArchOpcode uint8_op, ArchOpcode uint16_op, ArchOpcode uint32_op,
ArchOpcode uint64_op) {
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
MachineType type = AtomicOpType(node->op());
if (type == MachineType::Uint8()) {
opcode = uint8_op;
......@@ -2745,7 +2738,6 @@ void InstructionSelector::VisitWord64AtomicBinaryOperation(
opcode = uint64_op;
} else {
UNREACHABLE();
return;
}
VisitAtomicBinop(this, node, opcode);
}
......
......@@ -314,7 +314,7 @@ void InstructionSelector::VisitStore(Node* node) {
CHECK_EQ(is_atomic, false);
Emit(code, 0, nullptr, input_count, inputs, temp_count, temps);
} else {
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
ImmediateMode mode = kInt16Imm;
switch (rep) {
case MachineRepresentation::kFloat32:
......@@ -359,7 +359,6 @@ void InstructionSelector::VisitStore(Node* node) {
break;
case MachineRepresentation::kNone:
UNREACHABLE();
return;
}
if (g.CanBeImmediate(offset, mode)) {
......@@ -1951,7 +1950,7 @@ void VisitAtomicExchange(InstructionSelector* selector, Node* node,
}
void InstructionSelector::VisitWord32AtomicExchange(Node* node) {
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
MachineType type = AtomicOpType(node->op());
if (type == MachineType::Int8()) {
opcode = kWord32AtomicExchangeInt8;
......@@ -1965,13 +1964,12 @@ void InstructionSelector::VisitWord32AtomicExchange(Node* node) {
opcode = kPPC_AtomicExchangeWord32;
} else {
UNREACHABLE();
return;
}
VisitAtomicExchange(this, node, opcode);
}
void InstructionSelector::VisitWord64AtomicExchange(Node* node) {
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
MachineType type = AtomicOpType(node->op());
if (type == MachineType::Uint8()) {
opcode = kPPC_AtomicExchangeUint8;
......@@ -1983,7 +1981,6 @@ void InstructionSelector::VisitWord64AtomicExchange(Node* node) {
opcode = kPPC_AtomicExchangeWord64;
} else {
UNREACHABLE();
return;
}
VisitAtomicExchange(this, node, opcode);
}
......@@ -2015,7 +2012,7 @@ void VisitAtomicCompareExchange(InstructionSelector* selector, Node* node,
void InstructionSelector::VisitWord32AtomicCompareExchange(Node* node) {
MachineType type = AtomicOpType(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
if (type == MachineType::Int8()) {
opcode = kWord32AtomicCompareExchangeInt8;
} else if (type == MachineType::Uint8()) {
......@@ -2028,14 +2025,13 @@ void InstructionSelector::VisitWord32AtomicCompareExchange(Node* node) {
opcode = kPPC_AtomicCompareExchangeWord32;
} else {
UNREACHABLE();
return;
}
VisitAtomicCompareExchange(this, node, opcode);
}
void InstructionSelector::VisitWord64AtomicCompareExchange(Node* node) {
MachineType type = AtomicOpType(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
if (type == MachineType::Uint8()) {
opcode = kPPC_AtomicCompareExchangeUint8;
} else if (type == MachineType::Uint16()) {
......@@ -2046,7 +2042,6 @@ void InstructionSelector::VisitWord64AtomicCompareExchange(Node* node) {
opcode = kPPC_AtomicCompareExchangeWord64;
} else {
UNREACHABLE();
return;
}
VisitAtomicCompareExchange(this, node, opcode);
}
......@@ -2062,7 +2057,7 @@ void VisitAtomicBinaryOperation(InstructionSelector* selector, Node* node,
Node* value = node->InputAt(2);
MachineType type = AtomicOpType(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
if (type == MachineType::Int8()) {
opcode = int8_op;
......@@ -2082,7 +2077,6 @@ void VisitAtomicBinaryOperation(InstructionSelector* selector, Node* node,
opcode = uint64_op;
} else {
UNREACHABLE();
return;
}
AddressingMode addressing_mode = kMode_MRR;
......
......@@ -272,7 +272,7 @@ bool S390OpcodeOnlySupport12BitDisp(InstructionCode op) {
ArchOpcode SelectLoadOpcode(Node* node) {
LoadRepresentation load_rep = LoadRepresentationOf(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
switch (load_rep.representation()) {
case MachineRepresentation::kFloat32:
opcode = kS390_LoadFloat32;
......@@ -747,7 +747,7 @@ static void VisitGeneralStore(
code |= MiscField::encode(static_cast<int>(record_write_mode));
selector->Emit(code, 0, nullptr, input_count, inputs, temp_count, temps);
} else {
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
NodeMatcher m(value);
switch (rep) {
case MachineRepresentation::kFloat32:
......@@ -799,7 +799,6 @@ static void VisitGeneralStore(
break;
case MachineRepresentation::kNone:
UNREACHABLE();
return;
}
InstructionOperand inputs[4];
size_t input_count = 0;
......@@ -2302,7 +2301,7 @@ void VisitAtomicExchange(InstructionSelector* selector, Node* node,
}
void InstructionSelector::VisitWord32AtomicExchange(Node* node) {
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
MachineType type = AtomicOpType(node->op());
if (type == MachineType::Int8()) {
opcode = kWord32AtomicExchangeInt8;
......@@ -2316,13 +2315,12 @@ void InstructionSelector::VisitWord32AtomicExchange(Node* node) {
opcode = kWord32AtomicExchangeWord32;
} else {
UNREACHABLE();
return;
}
VisitAtomicExchange(this, node, opcode);
}
void InstructionSelector::VisitWord64AtomicExchange(Node* node) {
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
MachineType type = AtomicOpType(node->op());
if (type == MachineType::Uint8()) {
opcode = kS390_Word64AtomicExchangeUint8;
......@@ -2334,7 +2332,6 @@ void InstructionSelector::VisitWord64AtomicExchange(Node* node) {
opcode = kS390_Word64AtomicExchangeUint64;
} else {
UNREACHABLE();
return;
}
VisitAtomicExchange(this, node, opcode);
}
......@@ -2372,7 +2369,7 @@ void VisitAtomicCompareExchange(InstructionSelector* selector, Node* node,
void InstructionSelector::VisitWord32AtomicCompareExchange(Node* node) {
MachineType type = AtomicOpType(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
if (type == MachineType::Int8()) {
opcode = kWord32AtomicCompareExchangeInt8;
} else if (type == MachineType::Uint8()) {
......@@ -2385,14 +2382,13 @@ void InstructionSelector::VisitWord32AtomicCompareExchange(Node* node) {
opcode = kWord32AtomicCompareExchangeWord32;
} else {
UNREACHABLE();
return;
}
VisitAtomicCompareExchange(this, node, opcode);
}
void InstructionSelector::VisitWord64AtomicCompareExchange(Node* node) {
MachineType type = AtomicOpType(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
if (type == MachineType::Uint8()) {
opcode = kS390_Word64AtomicCompareExchangeUint8;
} else if (type == MachineType::Uint16()) {
......@@ -2403,7 +2399,6 @@ void InstructionSelector::VisitWord64AtomicCompareExchange(Node* node) {
opcode = kS390_Word64AtomicCompareExchangeUint64;
} else {
UNREACHABLE();
return;
}
VisitAtomicCompareExchange(this, node, opcode);
}
......@@ -2447,7 +2442,7 @@ void InstructionSelector::VisitWord32AtomicBinaryOperation(
Node* node, ArchOpcode int8_op, ArchOpcode uint8_op, ArchOpcode int16_op,
ArchOpcode uint16_op, ArchOpcode word32_op) {
MachineType type = AtomicOpType(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
if (type == MachineType::Int8()) {
opcode = int8_op;
......@@ -2461,7 +2456,6 @@ void InstructionSelector::VisitWord32AtomicBinaryOperation(
opcode = word32_op;
} else {
UNREACHABLE();
return;
}
VisitAtomicBinop(this, node, opcode);
}
......@@ -2484,7 +2478,7 @@ void InstructionSelector::VisitWord64AtomicBinaryOperation(
Node* node, ArchOpcode uint8_op, ArchOpcode uint16_op, ArchOpcode word32_op,
ArchOpcode word64_op) {
MachineType type = AtomicOpType(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
if (type == MachineType::Uint8()) {
opcode = uint8_op;
......@@ -2496,7 +2490,6 @@ void InstructionSelector::VisitWord64AtomicBinaryOperation(
opcode = word64_op;
} else {
UNREACHABLE();
return;
}
VisitAtomicBinop(this, node, opcode);
}
......
......@@ -241,7 +241,7 @@ class X64OperandGenerator final : public OperandGenerator {
namespace {
ArchOpcode GetLoadOpcode(LoadRepresentation load_rep) {
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
switch (load_rep.representation()) {
case MachineRepresentation::kFloat32:
opcode = kX64Movss;
......@@ -386,7 +386,7 @@ void InstructionSelector::VisitLoadLane(Node* node) {
void InstructionSelector::VisitLoadTransform(Node* node) {
LoadTransformParameters params = LoadTransformParametersOf(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
switch (params.transformation) {
case LoadTransformation::kS128Load8Splat:
opcode = kX64S128Load8Splat;
......@@ -687,7 +687,7 @@ bool TryMergeTruncateInt64ToInt32IntoLoad(InstructionSelector* selector,
if (load->opcode() == IrOpcode::kLoad && selector->CanCover(node, load)) {
LoadRepresentation load_rep = LoadRepresentationOf(load->op());
MachineRepresentation rep = load_rep.representation();
InstructionCode opcode = kArchNop;
InstructionCode opcode;
switch (rep) {
case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kWord8:
......@@ -1321,7 +1321,7 @@ void InstructionSelector::VisitChangeInt32ToInt64(Node* node) {
if (value->opcode() == IrOpcode::kLoad && CanCover(node, value)) {
LoadRepresentation load_rep = LoadRepresentationOf(value->op());
MachineRepresentation rep = load_rep.representation();
InstructionCode opcode = kArchNop;
InstructionCode opcode;
switch (rep) {
case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kWord8:
......@@ -1335,7 +1335,6 @@ void InstructionSelector::VisitChangeInt32ToInt64(Node* node) {
break;
default:
UNREACHABLE();
return;
}
InstructionOperand outputs[] = {g.DefineAsRegister(node)};
size_t input_count = 0;
......@@ -2584,7 +2583,7 @@ void InstructionSelector::VisitWord64AtomicLoad(Node* node) {
void InstructionSelector::VisitWord32AtomicStore(Node* node) {
MachineRepresentation rep = AtomicStoreRepresentationOf(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
switch (rep) {
case MachineRepresentation::kWord8:
opcode = kWord32AtomicExchangeInt8;
......@@ -2603,7 +2602,7 @@ void InstructionSelector::VisitWord32AtomicStore(Node* node) {
void InstructionSelector::VisitWord64AtomicStore(Node* node) {
MachineRepresentation rep = AtomicStoreRepresentationOf(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
switch (rep) {
case MachineRepresentation::kWord8:
opcode = kX64Word64AtomicExchangeUint8;
......@@ -2625,7 +2624,7 @@ void InstructionSelector::VisitWord64AtomicStore(Node* node) {
void InstructionSelector::VisitWord32AtomicExchange(Node* node) {
MachineType type = AtomicOpType(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
if (type == MachineType::Int8()) {
opcode = kWord32AtomicExchangeInt8;
} else if (type == MachineType::Uint8()) {
......@@ -2638,14 +2637,13 @@ void InstructionSelector::VisitWord32AtomicExchange(Node* node) {
opcode = kWord32AtomicExchangeWord32;
} else {
UNREACHABLE();
return;
}
VisitAtomicExchange(this, node, opcode);
}
void InstructionSelector::VisitWord64AtomicExchange(Node* node) {
MachineType type = AtomicOpType(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
if (type == MachineType::Uint8()) {
opcode = kX64Word64AtomicExchangeUint8;
} else if (type == MachineType::Uint16()) {
......@@ -2656,14 +2654,13 @@ void InstructionSelector::VisitWord64AtomicExchange(Node* node) {
opcode = kX64Word64AtomicExchangeUint64;
} else {
UNREACHABLE();
return;
}
VisitAtomicExchange(this, node, opcode);
}
void InstructionSelector::VisitWord32AtomicCompareExchange(Node* node) {
MachineType type = AtomicOpType(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
if (type == MachineType::Int8()) {
opcode = kWord32AtomicCompareExchangeInt8;
} else if (type == MachineType::Uint8()) {
......@@ -2676,14 +2673,13 @@ void InstructionSelector::VisitWord32AtomicCompareExchange(Node* node) {
opcode = kWord32AtomicCompareExchangeWord32;
} else {
UNREACHABLE();
return;
}
VisitAtomicCompareExchange(this, node, opcode);
}
void InstructionSelector::VisitWord64AtomicCompareExchange(Node* node) {
MachineType type = AtomicOpType(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
if (type == MachineType::Uint8()) {
opcode = kX64Word64AtomicCompareExchangeUint8;
} else if (type == MachineType::Uint16()) {
......@@ -2694,7 +2690,6 @@ void InstructionSelector::VisitWord64AtomicCompareExchange(Node* node) {
opcode = kX64Word64AtomicCompareExchangeUint64;
} else {
UNREACHABLE();
return;
}
VisitAtomicCompareExchange(this, node, opcode);
}
......@@ -2703,7 +2698,7 @@ void InstructionSelector::VisitWord32AtomicBinaryOperation(
Node* node, ArchOpcode int8_op, ArchOpcode uint8_op, ArchOpcode int16_op,
ArchOpcode uint16_op, ArchOpcode word32_op) {
MachineType type = AtomicOpType(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
if (type == MachineType::Int8()) {
opcode = int8_op;
} else if (type == MachineType::Uint8()) {
......@@ -2716,7 +2711,6 @@ void InstructionSelector::VisitWord32AtomicBinaryOperation(
opcode = word32_op;
} else {
UNREACHABLE();
return;
}
VisitAtomicBinop(this, node, opcode);
}
......@@ -2739,7 +2733,7 @@ void InstructionSelector::VisitWord64AtomicBinaryOperation(
Node* node, ArchOpcode uint8_op, ArchOpcode uint16_op, ArchOpcode uint32_op,
ArchOpcode word64_op) {
MachineType type = AtomicOpType(node->op());
ArchOpcode opcode = kArchNop;
ArchOpcode opcode;
if (type == MachineType::Uint8()) {
opcode = uint8_op;
} else if (type == MachineType::Uint16()) {
......@@ -2750,7 +2744,6 @@ void InstructionSelector::VisitWord64AtomicBinaryOperation(
opcode = word64_op;
} else {
UNREACHABLE();
return;
}
VisitAtomicBinop(this, node, opcode);
}
......
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