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

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

Issue 2362173003: [turbofan] Improve representation selection for Smi checking. (Closed)
Patch Set: Address comments Created 4 years, 3 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.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/simplified-lowering.cc
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc
index fc7dcf8f939344dba37a79bb1d7eaf4a45611763..a531b27ec87a63408961611d6ccf874d4d53ef39 100644
--- a/src/compiler/simplified-lowering.cc
+++ b/src/compiler/simplified-lowering.cc
@@ -2126,6 +2126,15 @@ class RepresentationSelector {
}
return;
}
+ case IrOpcode::kCheckHeapObject: {
+ if (InputCannotBe(node, Type::SignedSmall())) {
+ VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged);
+ if (lower()) DeferReplacement(node, node->InputAt(0));
+ } else {
+ VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged);
+ }
+ return;
+ }
case IrOpcode::kCheckIf: {
ProcessInput(node, 0, UseInfo::Bool());
ProcessRemainingInputs(node, 1);
@@ -2151,28 +2160,20 @@ class RepresentationSelector {
}
return;
}
- case IrOpcode::kCheckString: {
- if (InputIs(node, Type::String())) {
- VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged);
- if (lower()) DeferReplacement(node, node->InputAt(0));
+ case IrOpcode::kCheckSmi: {
+ if (SmiValuesAre32Bits() && truncation.IsUsedAsWord32()) {
+ VisitUnop(node, UseInfo::CheckedSignedSmallAsWord32(),
+ MachineRepresentation::kWord32);
} else {
- VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged);
+ VisitUnop(node, UseInfo::CheckedSignedSmallAsTaggedSigned(),
+ MachineRepresentation::kTaggedSigned);
}
+ if (lower()) DeferReplacement(node, node->InputAt(0));
return;
}
- case IrOpcode::kCheckTaggedPointer: {
- if (InputCannotBe(node, Type::SignedSmall())) {
- VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged);
- if (lower()) DeferReplacement(node, node->InputAt(0));
- } else {
+ case IrOpcode::kCheckString: {
+ if (InputIs(node, Type::String())) {
VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged);
- }
- return;
- }
- case IrOpcode::kCheckTaggedSigned: {
- if (SmiValuesAre32Bits() && truncation.IsUsedAsWord32()) {
- VisitUnop(node, UseInfo::CheckedSignedSmallAsWord32(),
- MachineRepresentation::kWord32);
if (lower()) DeferReplacement(node, node->InputAt(0));
} else {
VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged);
« no previous file with comments | « src/compiler/representation-change.cc ('k') | src/compiler/simplified-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698