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

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

Issue 801263002: [turbofan] Correctify TruncateFloat64ToInt32 reduction in MachineOperatorReducer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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 3e47ce8d95d8bda7333a295a895e8a00f8769fe2..558ad0070db5dcd8636e9938022d5787697ee6e4 100644
--- a/test/unittests/compiler/machine-operator-reducer-unittest.cc
+++ b/test/unittests/compiler/machine-operator-reducer-unittest.cc
@@ -469,6 +469,25 @@ TEST_F(MachineOperatorReducerTest, TruncateFloat64ToInt32WithPhi) {
}
+TEST_F(MachineOperatorReducerTest,
+ TruncateFloat64ToInt32WithPhiAndChangeInt32ToFloat64) {
+ Node* const p0 = Parameter(0);
+ Node* const merge = graph()->start();
+ Node* const truncate = graph()->NewNode(
+ machine()->TruncateFloat64ToInt32(),
+ graph()->NewNode(common()->Phi(kMachFloat64, 2), p0, p0, merge));
+ truncate->InputAt(0)->ReplaceInput(
+ 1, graph()->NewNode(machine()->ChangeInt32ToFloat64(), truncate));
+ Reduction reduction = Reduce(truncate);
+ ASSERT_TRUE(reduction.Changed());
+ Capture<Node*> phi;
+ EXPECT_THAT(
+ reduction.replacement(),
+ AllOf(CaptureEq(&phi), IsPhi(kMachInt32, IsTruncateFloat64ToInt32(p0),
+ CaptureEq(&phi), merge)));
+}
+
+
// -----------------------------------------------------------------------------
// TruncateInt64ToInt32
« 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