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

Unified Diff: src/compiler/simplified-lowering.cc

Issue 1471723002: [turbofan] Further simplify representation inference for NumberTo(U)int32. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | test/cctest/compiler/test-simplified-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/simplified-lowering.cc
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc
index b335389729ae8daabf6e5d6082874edcd6e51c2a..61468a2ba3b64c5224ba3722ddb5d65f22611f4a 100644
--- a/src/compiler/simplified-lowering.cc
+++ b/src/compiler/simplified-lowering.cc
@@ -130,7 +130,8 @@ class UseInfo {
};
-UseInfo UseInfoFromRepresentation(MachineTypeUnion rep) {
+UseInfo UseInfoFromMachineType(MachineType type) {
+ MachineTypeUnion rep = RepresentationOf(type);
DCHECK((rep & kTypeMask) == 0);
if (rep & kRepTagged) return UseInfo::AnyTagged();
if (rep & kRepFloat64) {
@@ -153,11 +154,6 @@ UseInfo UseInfoFromRepresentation(MachineTypeUnion rep) {
}
-UseInfo UseInfoFromMachineType(MachineType type) {
- return UseInfoFromRepresentation(RepresentationOf(type));
-}
-
-
UseInfo UseInfoForBasePointer(const FieldAccess& access) {
return access.tag() != 0 ? UseInfo::AnyTagged() : UseInfo::PointerInt();
}
@@ -827,35 +823,15 @@ class RepresentationSelector {
break;
}
case IrOpcode::kNumberToInt32: {
- MachineTypeUnion use_rep = use & kRepMask;
- Node* input = node->InputAt(0);
- Type* in_upper = NodeProperties::GetType(input);
- if (in_upper->Is(Type::Signed32())) {
- // If the input has type int32, pass through representation.
- VisitUnop(node, UseInfoFromRepresentation(use_rep),
- kTypeInt32 | use_rep);
- if (lower()) DeferReplacement(node, node->InputAt(0));
- } else {
- // Just change representation if necessary.
- VisitUnop(node, UseInfo::TruncatingWord32(), kMachInt32);
- if (lower()) DeferReplacement(node, node->InputAt(0));
- }
+ // Just change representation if necessary.
+ VisitUnop(node, UseInfo::TruncatingWord32(), kMachInt32);
+ if (lower()) DeferReplacement(node, node->InputAt(0));
break;
}
case IrOpcode::kNumberToUint32: {
- MachineTypeUnion use_rep = use & kRepMask;
- Node* input = node->InputAt(0);
- Type* in_upper = NodeProperties::GetType(input);
- if (in_upper->Is(Type::Unsigned32())) {
- // If the input has type uint32, pass through representation.
- VisitUnop(node, UseInfoFromRepresentation(use_rep),
- kTypeUint32 | use_rep);
- if (lower()) DeferReplacement(node, node->InputAt(0));
- } else {
- // Just change representation if necessary.
- VisitUnop(node, UseInfo::TruncatingWord32(), kMachUint32);
- if (lower()) DeferReplacement(node, node->InputAt(0));
- }
+ // Just change representation if necessary.
+ VisitUnop(node, UseInfo::TruncatingWord32(), kMachUint32);
+ if (lower()) DeferReplacement(node, node->InputAt(0));
break;
}
case IrOpcode::kNumberIsHoleNaN: {
« no previous file with comments | « no previous file | test/cctest/compiler/test-simplified-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698