From 184d640d2a3ac86d871dab58386a50cc9bb973f9 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Mon, 9 Jun 2014 14:06:02 +0100 Subject: Add a type propagation phase after building SSA. This ensures all phis have a type. Change-Id: I7e4f9a16d1efb5f64c493c1351749b352c870cbd --- compiler/optimizing/ssa_test.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'compiler/optimizing/ssa_test.cc') diff --git a/compiler/optimizing/ssa_test.cc b/compiler/optimizing/ssa_test.cc index 3b354f19d9..088a5c4240 100644 --- a/compiler/optimizing/ssa_test.cc +++ b/compiler/optimizing/ssa_test.cc @@ -87,6 +87,13 @@ static void TestCode(const uint16_t* data, const char* expected) { graph->TransformToSSA(); ReNumberInstructions(graph); + // Test that phis had their type set. + for (size_t i = 0, e = graph->GetBlocks().Size(); i < e; ++i) { + for (HInstructionIterator it(graph->GetBlocks().Get(i)->GetPhis()); !it.Done(); it.Advance()) { + ASSERT_NE(it.Current()->GetType(), Primitive::kPrimVoid); + } + } + SsaPrettyPrinter printer(graph); printer.VisitInsertionOrder(); -- cgit v1.2.3-59-g8ed1b