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