Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(971)

Unified Diff: src/compiler/representation-change.cc

Issue 2207893002: [turbofan] Consume SignedSmall feedback for number operations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/representation-change.h ('k') | src/compiler/simplified-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/representation-change.cc
diff --git a/src/compiler/representation-change.cc b/src/compiler/representation-change.cc
index 049ddfa05f77324ecf9ff33e7fdcc28fa98b3373..fcd616db0a9699ce231b5af35bf363e7955700ae 100644
--- a/src/compiler/representation-change.cc
+++ b/src/compiler/representation-change.cc
@@ -400,7 +400,8 @@ Node* RepresentationChanger::GetWord32RepresentationFor(
case IrOpcode::kFloat32Constant: {
float const fv = OpParameter<float>(node);
if (use_info.type_check() == TypeCheckKind::kNone ||
- (use_info.type_check() == TypeCheckKind::kSigned32 &&
+ ((use_info.type_check() == TypeCheckKind::kSignedSmall ||
+ use_info.type_check() == TypeCheckKind::kSigned32) &&
IsInt32Double(fv))) {
return MakeTruncatedInt32Constant(fv);
}
@@ -410,7 +411,8 @@ Node* RepresentationChanger::GetWord32RepresentationFor(
case IrOpcode::kFloat64Constant: {
double const fv = OpParameter<double>(node);
if (use_info.type_check() == TypeCheckKind::kNone ||
- (use_info.type_check() == TypeCheckKind::kSigned32 &&
+ ((use_info.type_check() == TypeCheckKind::kSignedSmall ||
+ use_info.type_check() == TypeCheckKind::kSigned32) &&
IsInt32Double(fv))) {
return MakeTruncatedInt32Constant(fv);
}
@@ -435,7 +437,8 @@ Node* RepresentationChanger::GetWord32RepresentationFor(
op = machine()->ChangeFloat64ToInt32();
} else if (use_info.truncation().IsUsedAsWord32()) {
op = machine()->TruncateFloat64ToWord32();
- } else if (use_info.type_check() == TypeCheckKind::kSigned32) {
+ } else if (use_info.type_check() == TypeCheckKind::kSignedSmall ||
+ use_info.type_check() == TypeCheckKind::kSigned32) {
op = simplified()->CheckedFloat64ToInt32();
}
} else if (output_rep == MachineRepresentation::kFloat32) {
@@ -446,7 +449,8 @@ Node* RepresentationChanger::GetWord32RepresentationFor(
op = machine()->ChangeFloat64ToInt32();
} else if (use_info.truncation().IsUsedAsWord32()) {
op = machine()->TruncateFloat64ToWord32();
- } else if (use_info.type_check() == TypeCheckKind::kSigned32) {
+ } else if (use_info.type_check() == TypeCheckKind::kSignedSmall ||
+ use_info.type_check() == TypeCheckKind::kSigned32) {
op = simplified()->CheckedFloat64ToInt32();
}
} else if (output_rep == MachineRepresentation::kTagged) {
@@ -462,13 +466,16 @@ Node* RepresentationChanger::GetWord32RepresentationFor(
} else {
op = simplified()->TruncateTaggedToWord32();
}
+ } else if (use_info.type_check() == TypeCheckKind::kSignedSmall) {
+ op = simplified()->CheckedTaggedSignedToInt32();
} else if (use_info.type_check() == TypeCheckKind::kSigned32) {
op = simplified()->CheckedTaggedToInt32();
}
} else if (output_rep == MachineRepresentation::kWord32) {
// Only the checked case should get here, the non-checked case is
// handled in GetRepresentationFor.
- if (use_info.type_check() == TypeCheckKind::kSigned32) {
+ if (use_info.type_check() == TypeCheckKind::kSignedSmall ||
+ use_info.type_check() == TypeCheckKind::kSigned32) {
if (output_type->Is(Type::Signed32())) {
return node;
} else if (output_type->Is(Type::Unsigned32())) {
@@ -481,7 +488,8 @@ Node* RepresentationChanger::GetWord32RepresentationFor(
} else if (output_rep == MachineRepresentation::kWord8 ||
output_rep == MachineRepresentation::kWord16) {
DCHECK(use_info.representation() == MachineRepresentation::kWord32);
- DCHECK(use_info.type_check() == TypeCheckKind::kSigned32);
+ DCHECK(use_info.type_check() == TypeCheckKind::kSignedSmall ||
+ use_info.type_check() == TypeCheckKind::kSigned32);
return node;
}
« no previous file with comments | « src/compiler/representation-change.h ('k') | src/compiler/simplified-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698