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

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

Issue 1072353002: [turbofan] Optimize silent hole checks on legacy const context slots. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comment. Created 5 years, 8 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/pointer-masking.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/common-operator-reducer-unittest.cc
diff --git a/test/unittests/compiler/common-operator-reducer-unittest.cc b/test/unittests/compiler/common-operator-reducer-unittest.cc
index ce10b1e63593729feb3bdafcf3da00315e52aa81..129eb425482b3ee96d0142bb97167e6368d28348 100644
--- a/test/unittests/compiler/common-operator-reducer-unittest.cc
+++ b/test/unittests/compiler/common-operator-reducer-unittest.cc
@@ -221,6 +221,28 @@ TEST_F(CommonOperatorReducerTest, RedundantSelect) {
}
+TEST_F(CommonOperatorReducerTest, SelectWithFalseConstant) {
+ Node* p0 = Parameter(0);
+ Node* p1 = Parameter(1);
+ Node* select = graph()->NewNode(common()->Select(kMachAnyTagged),
+ FalseConstant(), p0, p1);
+ Reduction r = Reduce(select);
+ ASSERT_TRUE(r.Changed());
+ EXPECT_EQ(p1, r.replacement());
+}
+
+
+TEST_F(CommonOperatorReducerTest, SelectWithTrueConstant) {
+ Node* p0 = Parameter(0);
+ Node* p1 = Parameter(1);
+ Node* select = graph()->NewNode(common()->Select(kMachAnyTagged),
+ TrueConstant(), p0, p1);
+ Reduction r = Reduce(select);
+ ASSERT_TRUE(r.Changed());
+ EXPECT_EQ(p0, r.replacement());
+}
+
+
TEST_F(CommonOperatorReducerTest, SelectToFloat32Abs) {
Node* p0 = Parameter(0);
Node* c0 = Float32Constant(0.0);
« no previous file with comments | « test/mjsunit/asm/pointer-masking.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698