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

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

Issue 2790833004: [turbofan] Better representation selection for comparison with Float64. (Closed)
Patch Set: REBASE and comment. Created 3 years, 9 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 | « no previous file | no next file » | 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 e017f1d2e401de0e193d9b32fb6654a003728a07..4af401df5c42a1239a387436b1d8fc96ec8866ee 100644
--- a/src/compiler/simplified-lowering.cc
+++ b/src/compiler/simplified-lowering.cc
@@ -701,6 +701,11 @@ class RepresentationSelector {
GetUpperBound(node->InputAt(1))->Is(type);
}
+ bool IsNodeRepresentationFloat64(Node* node) {
+ MachineRepresentation representation = GetInfo(node)->representation();
+ return representation == MachineRepresentation::kFloat64;
+ }
+
bool IsNodeRepresentationTagged(Node* node) {
MachineRepresentation representation = GetInfo(node)->representation();
return IsAnyTagged(representation);
@@ -1619,6 +1624,15 @@ class RepresentationSelector {
ChangeToPureOp(
node, changer_->TaggedSignedOperatorFor(node->opcode()));
+ } else if (IsNodeRepresentationFloat64(lhs) ||
+ IsNodeRepresentationFloat64(rhs)) {
+ // If one side is already a Float64, it's pretty expensive to
+ // do the comparison in Word32, since that means we need a
+ // checked conversion from Float64 to Word32. It's cheaper to
+ // just go to Float64 for the comparison.
+ VisitBinop(node, UseInfo::CheckedNumberAsFloat64(),
+ MachineRepresentation::kBit);
+ ChangeToPureOp(node, Float64Op(node));
} else {
VisitBinop(node, CheckedUseInfoAsWord32FromHint(hint),
MachineRepresentation::kBit);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698