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

Unified Diff: test/cctest/compiler/test-simplified-lowering.cc

Issue 545153002: [turbofan] Add MachineType to Phi. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add test case. Created 6 years, 3 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/cctest/compiler/test-scheduler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-simplified-lowering.cc
diff --git a/test/cctest/compiler/test-simplified-lowering.cc b/test/cctest/compiler/test-simplified-lowering.cc
index 6627807bf4467835ec9f9386a68067e35e92710a..dc32a2ac1500bee173c0328aa7161f7eb3322518 100644
--- a/test/cctest/compiler/test-simplified-lowering.cc
+++ b/test/cctest/compiler/test-simplified-lowering.cc
@@ -1420,3 +1420,28 @@ TEST(InsertChangeForStoreField) {
CHECK_EQ(t.p0, store->InputAt(0));
CheckChangeOf(IrOpcode::kChangeTaggedToFloat64, t.p1, store->InputAt(2));
}
+
+
+TEST(UpdatePhi) {
+ TestingGraph t(Type::Any(), Type::Signed32());
+ static const MachineType kMachineTypes[] = {kMachInt32, kMachUint32,
+ kMachFloat64};
+
+ for (size_t i = 0; i < arraysize(kMachineTypes); i++) {
+ FieldAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize,
+ Handle<Name>::null(), Type::Any(), kMachineTypes[i]};
+
+ Node* load0 =
+ t.graph()->NewNode(t.simplified()->LoadField(access), t.p0, t.start);
+ Node* load1 =
+ t.graph()->NewNode(t.simplified()->LoadField(access), t.p1, t.start);
+ Node* phi = t.graph()->NewNode(t.common()->Phi(kMachAnyTagged, 2), load0,
+ load1, t.start);
+ t.Return(t.Use(phi, kMachineTypes[i]));
+ t.Lower();
+
+ CHECK_EQ(IrOpcode::kPhi, phi->opcode());
+ CHECK_EQ(RepresentationOf(kMachineTypes[i]),
+ RepresentationOf(OpParameter<MachineType>(phi)));
+ }
+}
« no previous file with comments | « test/cctest/compiler/test-scheduler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698