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

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

Issue 2231963002: [turbofan] Avoid unnecessary minus zero checks for Float64->Tagged. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE 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/simplified-operator.h ('k') | test/unittests/compiler/simplified-operator-reducer-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/simplified-operator.cc
diff --git a/src/compiler/simplified-operator.cc b/src/compiler/simplified-operator.cc
index b20e5937a59cdc37a4908f68a18cb72a1af7431d..cf0c3deb56710143acb17e26c23ad9c99321d957 100644
--- a/src/compiler/simplified-operator.cc
+++ b/src/compiler/simplified-operator.cc
@@ -208,7 +208,8 @@ CheckFloat64HoleMode CheckFloat64HoleModeOf(const Operator* op) {
}
CheckForMinusZeroMode CheckMinusZeroModeOf(const Operator* op) {
- DCHECK(op->opcode() == IrOpcode::kCheckedInt32Mul ||
+ DCHECK(op->opcode() == IrOpcode::kChangeFloat64ToTagged ||
+ op->opcode() == IrOpcode::kCheckedInt32Mul ||
op->opcode() == IrOpcode::kCheckedFloat64ToInt32 ||
op->opcode() == IrOpcode::kCheckedTaggedToInt32);
return OpParameter<CheckForMinusZeroMode>(op);
@@ -395,7 +396,6 @@ NumberOperationHint NumberOperationHintOf(const Operator* op) {
V(ChangeInt31ToTaggedSigned, Operator::kNoProperties, 1, 0) \
V(ChangeInt32ToTagged, Operator::kNoProperties, 1, 0) \
V(ChangeUint32ToTagged, Operator::kNoProperties, 1, 0) \
- V(ChangeFloat64ToTagged, Operator::kNoProperties, 1, 0) \
V(ChangeTaggedToBit, Operator::kNoProperties, 1, 0) \
V(ChangeBitToTagged, Operator::kNoProperties, 1, 0) \
V(TruncateTaggedToWord32, Operator::kNoProperties, 1, 0) \
@@ -459,6 +459,19 @@ struct SimplifiedOperatorGlobalCache final {
#undef CHECKED
template <CheckForMinusZeroMode kMode>
+ struct ChangeFloat64ToTaggedOperator final
+ : public Operator1<CheckForMinusZeroMode> {
+ ChangeFloat64ToTaggedOperator()
+ : Operator1<CheckForMinusZeroMode>(
+ IrOpcode::kChangeFloat64ToTagged, Operator::kPure,
+ "ChangeFloat64ToTagged", 1, 0, 0, 1, 0, 0, kMode) {}
+ };
+ ChangeFloat64ToTaggedOperator<CheckForMinusZeroMode::kCheckForMinusZero>
+ kChangeFloat64ToTaggedCheckForMinusZeroOperator;
+ ChangeFloat64ToTaggedOperator<CheckForMinusZeroMode::kDontCheckForMinusZero>
+ kChangeFloat64ToTaggedDontCheckForMinusZeroOperator;
+
+ template <CheckForMinusZeroMode kMode>
struct CheckedInt32MulOperator final
: public Operator1<CheckForMinusZeroMode> {
CheckedInt32MulOperator()
@@ -603,6 +616,18 @@ PURE_OP_LIST(GET_FROM_CACHE)
CHECKED_OP_LIST(GET_FROM_CACHE)
#undef GET_FROM_CACHE
+const Operator* SimplifiedOperatorBuilder::ChangeFloat64ToTagged(
+ CheckForMinusZeroMode mode) {
+ switch (mode) {
+ case CheckForMinusZeroMode::kCheckForMinusZero:
+ return &cache_.kChangeFloat64ToTaggedCheckForMinusZeroOperator;
+ case CheckForMinusZeroMode::kDontCheckForMinusZero:
+ return &cache_.kChangeFloat64ToTaggedDontCheckForMinusZeroOperator;
+ }
+ UNREACHABLE();
+ return nullptr;
+}
+
const Operator* SimplifiedOperatorBuilder::CheckedInt32Mul(
CheckForMinusZeroMode mode) {
switch (mode) {
« no previous file with comments | « src/compiler/simplified-operator.h ('k') | test/unittests/compiler/simplified-operator-reducer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698