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

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

Issue 2080093002: [turbofan] Allow truncating minus zero in add, sub, mul if we have word32 truncation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 | « no previous file | src/type-cache.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 6c14884e29fc584a16ddfa15792c131de96c81d6..fcf9d4d6a04a1ad952403b4024fc5099fa53c5b2 100644
--- a/src/compiler/simplified-lowering.cc
+++ b/src/compiler/simplified-lowering.cc
@@ -1056,7 +1056,7 @@ class RepresentationSelector {
}
// Use truncation if available.
- if (BothInputsAre(node, type_cache_.kAdditiveSafeInteger) &&
+ if (BothInputsAre(node, type_cache_.kAdditiveSafeIntegerOrMinusZero) &&
truncation.TruncatesToWord32()) {
// safe-int + safe-int = x (truncated to int32)
// => signed Int32Add/Sub (truncated)
@@ -1282,7 +1282,8 @@ class RepresentationSelector {
// => signed Int32Add/Sub
VisitInt32Binop(node);
if (lower()) NodeProperties::ChangeOp(node, Int32Op(node));
- } else if (BothInputsAre(node, type_cache_.kAdditiveSafeInteger) &&
+ } else if (BothInputsAre(node,
+ type_cache_.kAdditiveSafeIntegerOrMinusZero) &&
truncation.TruncatesToWord32()) {
// safe-int + safe-int = x (truncated to int32)
// => signed Int32Add/Sub (truncated)
@@ -1305,7 +1306,8 @@ class RepresentationSelector {
return;
}
if (truncation.TruncatesToWord32() &&
- NodeProperties::GetType(node)->Is(type_cache_.kSafeInteger)) {
+ NodeProperties::GetType(node)->Is(
+ type_cache_.kSafeIntegerOrMinusZero)) {
// Multiply reduces to Int32Mul if the inputs are integers,
// the uses are truncating and the result is in the safe
// integer range.
« no previous file with comments | « no previous file | src/type-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698