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

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

Issue 735623002: [turbofan] Avoid useless sign extension after sign extended load. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years, 1 month 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/machine-operator-reducer.cc ('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 065a734e2038257a15ff58de0a048d16987e80d1..1284c566a3431d75b20407bbaf1252e19b360df2 100644
--- a/test/unittests/compiler/machine-operator-reducer-unittest.cc
+++ b/test/unittests/compiler/machine-operator-reducer-unittest.cc
@@ -645,6 +645,36 @@ TEST_F(MachineOperatorReducerTest, Word32RorWithConstants) {
// -----------------------------------------------------------------------------
+// Word32Sar
+
+
+TEST_F(MachineOperatorReducerTest, Word32SarWithWord32ShlAndLoad) {
+ Node* const p0 = Parameter(0);
+ Node* const p1 = Parameter(1);
+ {
+ Node* const l = graph()->NewNode(machine()->Load(kMachInt8), p0, p1,
+ graph()->start(), graph()->start());
+ Reduction const r = Reduce(graph()->NewNode(
+ machine()->Word32Sar(),
+ graph()->NewNode(machine()->Word32Shl(), l, Int32Constant(24)),
+ Int32Constant(24)));
+ ASSERT_TRUE(r.Changed());
+ EXPECT_EQ(l, r.replacement());
+ }
+ {
+ Node* const l = graph()->NewNode(machine()->Load(kMachInt16), p0, p1,
+ graph()->start(), graph()->start());
+ Reduction const r = Reduce(graph()->NewNode(
+ machine()->Word32Sar(),
+ graph()->NewNode(machine()->Word32Shl(), l, Int32Constant(16)),
+ Int32Constant(16)));
+ ASSERT_TRUE(r.Changed());
+ EXPECT_EQ(l, r.replacement());
+ }
+}
+
+
+// -----------------------------------------------------------------------------
// Word32Shl
« no previous file with comments | « src/compiler/machine-operator-reducer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698