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

Unified Diff: src/compiler/typed-optimization.cc

Issue 2739573004: [turbofan] Extend optimization of flooring integer division. (Closed)
Patch Set: Address offline feedback. 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 | « src/compiler/operation-typer.cc ('k') | test/unittests/compiler/typer-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/typed-optimization.cc
diff --git a/src/compiler/typed-optimization.cc b/src/compiler/typed-optimization.cc
index e130a10e4eb8e196e9b153d7c52f5f0792b534b6..bc0d80ade0aeaf8df83cb9d2caefa9dcbf388019 100644
--- a/src/compiler/typed-optimization.cc
+++ b/src/compiler/typed-optimization.cc
@@ -195,7 +195,8 @@ Reduction TypedOptimization::ReduceNumberFloor(Node* node) {
return Replace(input);
}
if (input_type->Is(Type::PlainNumber()) &&
- input->opcode() == IrOpcode::kNumberDivide) {
+ (input->opcode() == IrOpcode::kNumberDivide ||
+ input->opcode() == IrOpcode::kSpeculativeNumberDivide)) {
Node* const lhs = NodeProperties::GetValueInput(input, 0);
Type* const lhs_type = NodeProperties::GetType(lhs);
Node* const rhs = NodeProperties::GetValueInput(input, 1);
@@ -218,6 +219,11 @@ Reduction TypedOptimization::ReduceNumberFloor(Node* node) {
NodeProperties::SetType(node, lhs_type);
return Changed(node);
}
+ if (lhs_type->Is(Type::Signed32()) && rhs_type->Is(Type::Unsigned32())) {
+ NodeProperties::ChangeOp(node, simplified()->NumberToInt32());
+ NodeProperties::SetType(node, lhs_type);
+ return Changed(node);
+ }
}
return NoChange();
}
« no previous file with comments | « src/compiler/operation-typer.cc ('k') | test/unittests/compiler/typer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698