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

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

Issue 931623002: [turbofan] Optimize certain chains of Branch into a Switch. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addrssed comments. Created 5 years, 10 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/asm/switch.js ('k') | test/unittests/compiler/control-flow-optimizer-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler/common-operator-unittest.cc
diff --git a/test/unittests/compiler/common-operator-unittest.cc b/test/unittests/compiler/common-operator-unittest.cc
index 1f0c0fdaa4ab0b04900b701fd06e6e2d5dea7107..6e60cfd12ae228884390d8a388bc4b21c4a00155 100644
--- a/test/unittests/compiler/common-operator-unittest.cc
+++ b/test/unittests/compiler/common-operator-unittest.cc
@@ -133,7 +133,7 @@ class CommonOperatorTest : public TestWithZone {
const int kArguments[] = {1, 5, 6, 42, 100, 10000, 65000};
-const size_t kCases[] = {2, 3, 4, 100, 255};
+const size_t kCases[] = {3, 4, 100, 255, 1024, 65000};
const float kFloatValues[] = {-std::numeric_limits<float>::infinity(),
@@ -160,6 +160,20 @@ const double kDoubleValues[] = {-std::numeric_limits<double>::infinity(),
std::numeric_limits<double>::signaling_NaN()};
+const int32_t kInt32Values[] = {
+ std::numeric_limits<int32_t>::min(), -1914954528, -1698749618, -1578693386,
+ -1577976073, -1573998034, -1529085059, -1499540537, -1299205097,
+ -1090814845, -938186388, -806828902, -750927650, -520676892, -513661538,
+ -453036354, -433622833, -282638793, -28375, -27788, -22770, -18806, -14173,
+ -11956, -11200, -10212, -8160, -3751, -2758, -1522, -121, -120, -118, -117,
+ -106, -84, -80, -74, -59, -52, -48, -39, -35, -17, -11, -10, -9, -7, -5, 0,
+ 9, 12, 17, 23, 29, 31, 33, 35, 40, 47, 55, 56, 62, 64, 67, 68, 69, 74, 79,
+ 84, 89, 90, 97, 104, 118, 124, 126, 127, 7278, 17787, 24136, 24202, 25570,
+ 26680, 30242, 32399, 420886487, 642166225, 821912648, 822577803, 851385718,
+ 1212241078, 1411419304, 1589626102, 1596437184, 1876245816, 1954730266,
+ 2008792749, 2045320228, std::numeric_limits<int32_t>::max()};
+
+
const BranchHint kHints[] = {BranchHint::kNone, BranchHint::kTrue,
BranchHint::kFalse};
@@ -199,12 +213,12 @@ TEST_F(CommonOperatorTest, Switch) {
}
-TEST_F(CommonOperatorTest, Case) {
- TRACED_FORRANGE(size_t, index, 0, 1024) {
- const Operator* const op = common()->Case(index);
- EXPECT_EQ(IrOpcode::kCase, op->opcode());
+TEST_F(CommonOperatorTest, IfValue) {
+ TRACED_FOREACH(int32_t, value, kInt32Values) {
+ const Operator* const op = common()->IfValue(value);
+ EXPECT_EQ(IrOpcode::kIfValue, op->opcode());
EXPECT_EQ(Operator::kKontrol, op->properties());
- EXPECT_EQ(index, CaseIndexOf(op));
+ EXPECT_EQ(value, OpParameter<int32_t>(op));
EXPECT_EQ(0, op->ValueInputCount());
EXPECT_EQ(0, op->EffectInputCount());
EXPECT_EQ(1, op->ControlInputCount());
« no previous file with comments | « test/mjsunit/asm/switch.js ('k') | test/unittests/compiler/control-flow-optimizer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698