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

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

Issue 2923543003: [turbofan] Properly support Number feedback for binary operators. (Closed)
Patch Set: Improve DCHECK. Created 3 years, 6 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/js-typed-lowering.cc ('k') | src/compiler/simplified-operator.h » ('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 b3aaed9ffe2bfc12291fc0a029bcf374fee5647a..68261c69d3ca6a47f872c9ce8eed0d70f89c0241 100644
--- a/src/compiler/representation-change.cc
+++ b/src/compiler/representation-change.cc
@@ -674,22 +674,11 @@ Node* RepresentationChanger::GetWord32RepresentationFor(
return TypeError(node, output_rep, output_type,
MachineRepresentation::kWord32);
}
- } else if (output_rep == MachineRepresentation::kTaggedSigned) {
- if (output_type->Is(Type::Signed32())) {
+ } else if (IsAnyTagged(output_rep)) {
+ if (output_rep == MachineRepresentation::kTaggedSigned &&
+ output_type->Is(Type::SignedSmall())) {
op = simplified()->ChangeTaggedSignedToInt32();
- } else if (use_info.truncation().IsUsedAsWord32()) {
- if (use_info.type_check() != TypeCheckKind::kNone) {
- op = simplified()->CheckedTruncateTaggedToWord32();
- } else {
- op = simplified()->TruncateTaggedToWord32();
- }
- } else {
- return TypeError(node, output_rep, output_type,
- MachineRepresentation::kWord32);
- }
- } else if (output_rep == MachineRepresentation::kTagged ||
- output_rep == MachineRepresentation::kTaggedPointer) {
- if (output_type->Is(Type::Signed32())) {
+ } else if (output_type->Is(Type::Signed32())) {
op = simplified()->ChangeTaggedToInt32();
} else if (use_info.type_check() == TypeCheckKind::kSignedSmall) {
op = simplified()->CheckedTaggedSignedToInt32();
@@ -703,8 +692,12 @@ Node* RepresentationChanger::GetWord32RepresentationFor(
} else if (use_info.truncation().IsUsedAsWord32()) {
if (output_type->Is(Type::NumberOrOddball())) {
op = simplified()->TruncateTaggedToWord32();
- } else if (use_info.type_check() != TypeCheckKind::kNone) {
- op = simplified()->CheckedTruncateTaggedToWord32();
+ } else if (use_info.type_check() == TypeCheckKind::kNumber) {
+ op = simplified()->CheckedTruncateTaggedToWord32(
+ CheckTaggedInputMode::kNumber);
+ } else if (use_info.type_check() == TypeCheckKind::kNumberOrOddball) {
+ op = simplified()->CheckedTruncateTaggedToWord32(
+ CheckTaggedInputMode::kNumberOrOddball);
} else {
return TypeError(node, output_rep, output_type,
MachineRepresentation::kWord32);
@@ -726,8 +719,8 @@ Node* RepresentationChanger::GetWord32RepresentationFor(
return TypeError(node, output_rep, output_type,
MachineRepresentation::kWord32);
}
- } else {
- DCHECK_EQ(TypeCheckKind::kNumberOrOddball, use_info.type_check());
+ } else if (use_info.type_check() == TypeCheckKind::kNumber ||
+ use_info.type_check() == TypeCheckKind::kNumberOrOddball) {
return node;
}
} else if (output_rep == MachineRepresentation::kWord8 ||
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | src/compiler/simplified-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698