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

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

Issue 704463004: [turbofan] Turn various diamonds into selects. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix cctest. 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 | « test/unittests/compiler/js-builtin-reducer-unittest.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 268afc4b275135aa2e407eb98f935a8ab3fe5b13..651630ec89a2b908c4f941718f48720baa0a14f1 100644
--- a/test/unittests/compiler/machine-operator-reducer-unittest.cc
+++ b/test/unittests/compiler/machine-operator-reducer-unittest.cc
@@ -876,44 +876,30 @@ TEST_F(MachineOperatorReducerTest, Int32ModWithConstant) {
Reduction const r =
Reduce(graph()->NewNode(machine()->Int32Mod(), p0,
Int32Constant(1 << shift), graph()->start()));
- ASSERT_TRUE(r.Changed());
-
- Capture<Node*> branch;
- Node* const phi = r.replacement();
int32_t const mask = (1 << shift) - 1;
+ ASSERT_TRUE(r.Changed());
EXPECT_THAT(
- phi, IsPhi(kMachInt32,
- IsInt32Sub(IsInt32Constant(0),
- IsWord32And(IsInt32Sub(IsInt32Constant(0), p0),
- IsInt32Constant(mask))),
- IsWord32And(p0, IsInt32Constant(mask)),
- IsMerge(IsIfTrue(CaptureEq(&branch)),
- IsIfFalse(AllOf(
- CaptureEq(&branch),
- IsBranch(IsInt32LessThan(p0, IsInt32Constant(0)),
- graph()->start()))))));
+ r.replacement(),
+ IsSelect(kMachInt32, IsInt32LessThan(p0, IsInt32Constant(0)),
+ IsInt32Sub(IsInt32Constant(0),
+ IsWord32And(IsInt32Sub(IsInt32Constant(0), p0),
+ IsInt32Constant(mask))),
+ IsWord32And(p0, IsInt32Constant(mask))));
}
TRACED_FORRANGE(int32_t, shift, 1, 31) {
Reduction const r = Reduce(graph()->NewNode(
machine()->Int32Mod(), p0,
Uint32Constant(bit_cast<uint32_t, int32_t>(-1) << shift),
graph()->start()));
- ASSERT_TRUE(r.Changed());
-
- Capture<Node*> branch;
- Node* const phi = r.replacement();
int32_t const mask = bit_cast<int32_t, uint32_t>((1U << shift) - 1);
+ ASSERT_TRUE(r.Changed());
EXPECT_THAT(
- phi, IsPhi(kMachInt32,
- IsInt32Sub(IsInt32Constant(0),
- IsWord32And(IsInt32Sub(IsInt32Constant(0), p0),
- IsInt32Constant(mask))),
- IsWord32And(p0, IsInt32Constant(mask)),
- IsMerge(IsIfTrue(CaptureEq(&branch)),
- IsIfFalse(AllOf(
- CaptureEq(&branch),
- IsBranch(IsInt32LessThan(p0, IsInt32Constant(0)),
- graph()->start()))))));
+ r.replacement(),
+ IsSelect(kMachInt32, IsInt32LessThan(p0, IsInt32Constant(0)),
+ IsInt32Sub(IsInt32Constant(0),
+ IsWord32And(IsInt32Sub(IsInt32Constant(0), p0),
+ IsInt32Constant(mask))),
+ IsWord32And(p0, IsInt32Constant(mask))));
}
TRACED_FOREACH(int32_t, divisor, kInt32Values) {
if (divisor == 0 || base::bits::IsPowerOfTwo32(Abs(divisor))) continue;
« no previous file with comments | « test/unittests/compiler/js-builtin-reducer-unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698