Commit 5a8f1efe authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

Remove obsolete {Binary,Number}OperationHint::kSigned32

Change-Id: Ib1855adbf0292381f2b279d5b44fbddff551a4d5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2557499
Auto-Submit: Georg Neis <neis@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71365}
parent ba1b2cc0
......@@ -27,9 +27,6 @@ bool BinaryOperationHintToNumberOperationHint(
case BinaryOperationHint::kSignedSmallInputs:
*number_hint = NumberOperationHint::kSignedSmallInputs;
return true;
case BinaryOperationHint::kSigned32:
*number_hint = NumberOperationHint::kSigned32;
return true;
case BinaryOperationHint::kNumber:
*number_hint = NumberOperationHint::kNumber;
return true;
......@@ -50,7 +47,6 @@ bool BinaryOperationHintToBigIntOperationHint(
switch (binop_hint) {
case BinaryOperationHint::kSignedSmall:
case BinaryOperationHint::kSignedSmallInputs:
case BinaryOperationHint::kSigned32:
case BinaryOperationHint::kNumber:
case BinaryOperationHint::kNumberOrOddball:
case BinaryOperationHint::kAny:
......@@ -119,15 +115,13 @@ class JSSpeculativeBinopBuilder final {
const Operator* SpeculativeNumberOp(NumberOperationHint hint) {
switch (op_->opcode()) {
case IrOpcode::kJSAdd:
if (hint == NumberOperationHint::kSignedSmall ||
hint == NumberOperationHint::kSigned32) {
if (hint == NumberOperationHint::kSignedSmall) {
return simplified()->SpeculativeSafeIntegerAdd(hint);
} else {
return simplified()->SpeculativeNumberAdd(hint);
}
case IrOpcode::kJSSubtract:
if (hint == NumberOperationHint::kSignedSmall ||
hint == NumberOperationHint::kSigned32) {
if (hint == NumberOperationHint::kSignedSmall) {
return simplified()->SpeculativeSafeIntegerSubtract(hint);
} else {
return simplified()->SpeculativeNumberSubtract(hint);
......
......@@ -101,8 +101,6 @@ UseInfo CheckedUseInfoAsWord32FromHint(
case NumberOperationHint::kSignedSmall:
case NumberOperationHint::kSignedSmallInputs:
return UseInfo::CheckedSignedSmallAsWord32(identify_zeros, feedback);
case NumberOperationHint::kSigned32:
return UseInfo::CheckedSigned32AsWord32(identify_zeros, feedback);
case NumberOperationHint::kNumber:
return UseInfo::CheckedNumberAsWord32(feedback);
case NumberOperationHint::kNumberOrBoolean:
......@@ -120,7 +118,6 @@ UseInfo CheckedUseInfoAsFloat64FromHint(
switch (hint) {
case NumberOperationHint::kSignedSmall:
case NumberOperationHint::kSignedSmallInputs:
case NumberOperationHint::kSigned32:
// Not used currently.
UNREACHABLE();
case NumberOperationHint::kNumber:
......@@ -1447,8 +1444,7 @@ class RepresentationSelector {
// Try to use type feedback.
NumberOperationHint hint = NumberOperationHintOf(node->op());
DCHECK(hint == NumberOperationHint::kSignedSmall ||
hint == NumberOperationHint::kSigned32);
DCHECK_EQ(hint, NumberOperationHint::kSignedSmall);
Type left_feedback_type = TypeOf(node->InputAt(0));
Type right_feedback_type = TypeOf(node->InputAt(1));
......@@ -1559,8 +1555,7 @@ class RepresentationSelector {
// Handle the case when no uint32 checks on inputs are necessary
// (but an overflow check is needed on the output).
if (BothInputsAreUnsigned32(node)) {
if (hint == NumberOperationHint::kSignedSmall ||
hint == NumberOperationHint::kSigned32) {
if (hint == NumberOperationHint::kSignedSmall) {
VisitBinop<T>(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32, Type::Unsigned32());
if (lower<T>()) ChangeToUint32OverflowOp(node);
......@@ -1572,8 +1567,7 @@ class RepresentationSelector {
// (but an overflow check is needed on the output).
if (BothInputsAre(node, Type::Signed32())) {
// If both the inputs the feedback are int32, use the overflow op.
if (hint == NumberOperationHint::kSignedSmall ||
hint == NumberOperationHint::kSigned32) {
if (hint == NumberOperationHint::kSignedSmall) {
VisitBinop<T>(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32, Type::Signed32());
if (lower<T>()) ChangeToInt32OverflowOp(node);
......@@ -1581,8 +1575,7 @@ class RepresentationSelector {
}
}
if (hint == NumberOperationHint::kSignedSmall ||
hint == NumberOperationHint::kSigned32) {
if (hint == NumberOperationHint::kSignedSmall) {
// If the result is truncated, we only need to check the inputs.
// For the left hand side we just propagate the identify zeros
// mode of the {truncation}; and for modulus the sign of the
......@@ -2057,7 +2050,6 @@ class RepresentationSelector {
// Try to use type feedback.
NumberOperationHint hint = NumberOperationHintOf(node->op());
switch (hint) {
case NumberOperationHint::kSigned32:
case NumberOperationHint::kSignedSmall:
if (propagate<T>()) {
VisitBinop<T>(node,
......@@ -2160,8 +2152,7 @@ class RepresentationSelector {
// (but an overflow check is needed on the output).
if (BothInputsAre(node, Type::Signed32())) {
// If both inputs and feedback are int32, use the overflow op.
if (hint == NumberOperationHint::kSignedSmall ||
hint == NumberOperationHint::kSigned32) {
if (hint == NumberOperationHint::kSignedSmall) {
VisitBinop<T>(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32, Type::Signed32());
if (lower<T>()) {
......@@ -2172,8 +2163,7 @@ class RepresentationSelector {
}
}
if (hint == NumberOperationHint::kSignedSmall ||
hint == NumberOperationHint::kSigned32) {
if (hint == NumberOperationHint::kSignedSmall) {
VisitBinop<T>(node, CheckedUseInfoAsWord32FromHint(hint),
MachineRepresentation::kWord32, Type::Signed32());
if (lower<T>()) {
......@@ -2239,8 +2229,7 @@ class RepresentationSelector {
// Handle the case when no uint32 checks on inputs are necessary
// (but an overflow check is needed on the output).
if (BothInputsAreUnsigned32(node)) {
if (hint == NumberOperationHint::kSignedSmall ||
hint == NumberOperationHint::kSigned32) {
if (hint == NumberOperationHint::kSignedSmall) {
VisitBinop<T>(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32, Type::Unsigned32());
if (lower<T>()) ChangeToUint32OverflowOp(node);
......@@ -2252,8 +2241,7 @@ class RepresentationSelector {
// (but an overflow check is needed on the output).
if (BothInputsAreSigned32(node)) {
// If both the inputs the feedback are int32, use the overflow op.
if (hint == NumberOperationHint::kSignedSmall ||
hint == NumberOperationHint::kSigned32) {
if (hint == NumberOperationHint::kSignedSmall) {
VisitBinop<T>(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32, Type::Signed32());
if (lower<T>()) ChangeToInt32OverflowOp(node);
......@@ -2261,8 +2249,7 @@ class RepresentationSelector {
}
}
if (hint == NumberOperationHint::kSigned32 ||
hint == NumberOperationHint::kSignedSmall ||
if (hint == NumberOperationHint::kSignedSmall ||
hint == NumberOperationHint::kSignedSmallInputs) {
// If the result is truncated, we only need to check the inputs.
if (truncation.IsUsedAsWord32()) {
......@@ -2442,8 +2429,7 @@ class RepresentationSelector {
NumberOperationHint hint = NumberOperationHintOf(node->op());
Type rhs_type = GetUpperBound(node->InputAt(1));
if (rhs_type.Is(type_cache_->kZeroish) &&
(hint == NumberOperationHint::kSignedSmall ||
hint == NumberOperationHint::kSigned32) &&
hint == NumberOperationHint::kSignedSmall &&
!truncation.IsUsedAsWord32()) {
// The SignedSmall or Signed32 feedback means that the results that we
// have seen so far were of type Unsigned31. We speculate that this
......@@ -3330,7 +3316,6 @@ class RepresentationSelector {
NumberOperationParameters const& p =
NumberOperationParametersOf(node->op());
switch (p.hint()) {
case NumberOperationHint::kSigned32:
case NumberOperationHint::kSignedSmall:
case NumberOperationHint::kSignedSmallInputs:
VisitUnop<T>(node,
......
......@@ -561,8 +561,6 @@ std::ostream& operator<<(std::ostream& os, NumberOperationHint hint) {
return os << "SignedSmall";
case NumberOperationHint::kSignedSmallInputs:
return os << "SignedSmallInputs";
case NumberOperationHint::kSigned32:
return os << "Signed32";
case NumberOperationHint::kNumber:
return os << "Number";
case NumberOperationHint::kNumberOrBoolean:
......@@ -1188,7 +1186,6 @@ struct SimplifiedOperatorGlobalCache final {
k##Name##SignedSmallOperator; \
Name##Operator<NumberOperationHint::kSignedSmallInputs> \
k##Name##SignedSmallInputsOperator; \
Name##Operator<NumberOperationHint::kSigned32> k##Name##Signed32Operator; \
Name##Operator<NumberOperationHint::kNumber> k##Name##NumberOperator; \
Name##Operator<NumberOperationHint::kNumberOrOddball> \
k##Name##NumberOrOddballOperator;
......@@ -1209,8 +1206,6 @@ struct SimplifiedOperatorGlobalCache final {
};
SpeculativeToNumberOperator<NumberOperationHint::kSignedSmall>
kSpeculativeToNumberSignedSmallOperator;
SpeculativeToNumberOperator<NumberOperationHint::kSigned32>
kSpeculativeToNumberSigned32Operator;
SpeculativeToNumberOperator<NumberOperationHint::kNumber>
kSpeculativeToNumberNumberOperator;
SpeculativeToNumberOperator<NumberOperationHint::kNumberOrOddball>
......@@ -1595,8 +1590,6 @@ const Operator* SimplifiedOperatorBuilder::SpeculativeToNumber(
return &cache_.kSpeculativeToNumberSignedSmallOperator;
case NumberOperationHint::kSignedSmallInputs:
break;
case NumberOperationHint::kSigned32:
return &cache_.kSpeculativeToNumberSigned32Operator;
case NumberOperationHint::kNumber:
return &cache_.kSpeculativeToNumberNumberOperator;
case NumberOperationHint::kNumberOrBoolean:
......@@ -1837,8 +1830,6 @@ const Operator* SimplifiedOperatorBuilder::AllocateRaw(
return &cache_.k##Name##SignedSmallOperator; \
case NumberOperationHint::kSignedSmallInputs: \
return &cache_.k##Name##SignedSmallInputsOperator; \
case NumberOperationHint::kSigned32: \
return &cache_.k##Name##Signed32Operator; \
case NumberOperationHint::kNumber: \
return &cache_.k##Name##NumberOperator; \
case NumberOperationHint::kNumberOrBoolean: \
......@@ -1861,8 +1852,6 @@ const Operator* SimplifiedOperatorBuilder::SpeculativeNumberEqual(
return &cache_.kSpeculativeNumberEqualSignedSmallOperator;
case NumberOperationHint::kSignedSmallInputs:
return &cache_.kSpeculativeNumberEqualSignedSmallInputsOperator;
case NumberOperationHint::kSigned32:
return &cache_.kSpeculativeNumberEqualSigned32Operator;
case NumberOperationHint::kNumber:
return &cache_.kSpeculativeNumberEqualNumberOperator;
case NumberOperationHint::kNumberOrBoolean:
......
......@@ -559,7 +559,6 @@ Type ValueTypeParameterOf(const Operator* op) V8_WARN_UNUSED_RESULT;
enum class NumberOperationHint : uint8_t {
kSignedSmall, // Inputs were Smi, output was in Smi.
kSignedSmallInputs, // Inputs were Smi, output was Number.
kSigned32, // Inputs were Signed32, output was Number.
kNumber, // Inputs were Number, output was Number.
kNumberOrBoolean, // Inputs were Number or Boolean, output was Number.
kNumberOrOddball, // Inputs were Number or Oddball, output was Number.
......
......@@ -15,8 +15,6 @@ std::ostream& operator<<(std::ostream& os, BinaryOperationHint hint) {
return os << "SignedSmall";
case BinaryOperationHint::kSignedSmallInputs:
return os << "SignedSmallInputs";
case BinaryOperationHint::kSigned32:
return os << "Signed32";
case BinaryOperationHint::kNumber:
return os << "Number";
case BinaryOperationHint::kNumberOrOddball:
......
......@@ -16,7 +16,6 @@ enum class BinaryOperationHint : uint8_t {
kNone,
kSignedSmall,
kSignedSmallInputs,
kSigned32,
kNumber,
kNumberOrOddball,
kString,
......
......@@ -77,7 +77,6 @@ const CheckTaggedInputMode kCheckTaggedInputModes[] = {
const NumberOperationHint kNumberOperationHints[] = {
NumberOperationHint::kSignedSmall,
NumberOperationHint::kSignedSmallInputs,
NumberOperationHint::kSigned32,
NumberOperationHint::kNumber,
NumberOperationHint::kNumberOrOddball,
};
......
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