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

Unified Diff: test/unittests/compiler/machine-operator-reducer-unittest.cc

Issue 2167643002: [Turbofan] Make the -0 deopt case more efficient in multiplication. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix nit. Created 4 years, 5 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 | « test/mjsunit/compiler/math-mul.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler/machine-operator-reducer-unittest.cc
diff --git a/test/unittests/compiler/machine-operator-reducer-unittest.cc b/test/unittests/compiler/machine-operator-reducer-unittest.cc
index 7de6c7d2f24a6beffe37f5a5ffa4ac9f4af6bfc9..6f76d5cebcc061e7f216e8e0df95a6512ee471fb 100644
--- a/test/unittests/compiler/machine-operator-reducer-unittest.cc
+++ b/test/unittests/compiler/machine-operator-reducer-unittest.cc
@@ -289,7 +289,6 @@ TEST_F(MachineOperatorReducerTest,
EXPECT_EQ(value, reduction.replacement());
}
-
TEST_F(MachineOperatorReducerTest, ChangeFloat64ToInt32WithConstant) {
TRACED_FOREACH(int32_t, x, kInt32Values) {
Reduction reduction = Reduce(graph()->NewNode(
@@ -1506,6 +1505,26 @@ TEST_F(MachineOperatorReducerTest, Int32MulWithOverflowWithConstant) {
}
// -----------------------------------------------------------------------------
+// Int32LessThan
+
+TEST_F(MachineOperatorReducerTest, Int32LessThanWithWord32Or) {
+ Node* const p0 = Parameter(0);
+ TRACED_FOREACH(int32_t, x, kInt32Values) {
+ Node* word32_or =
+ graph()->NewNode(machine()->Word32Or(), p0, Int32Constant(x));
+ Node* less_than = graph()->NewNode(machine()->Int32LessThan(), word32_or,
+ Int32Constant(0));
+ Reduction r = Reduce(less_than);
+ if (x < 0) {
+ ASSERT_TRUE(r.Changed());
+ EXPECT_THAT(r.replacement(), IsInt32Constant(1));
+ } else {
+ ASSERT_FALSE(r.Changed());
+ }
+ }
+}
+
+// -----------------------------------------------------------------------------
// Uint32LessThan
TEST_F(MachineOperatorReducerTest, Uint32LessThanWithWord32Sar) {
« no previous file with comments | « test/mjsunit/compiler/math-mul.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698