Give an expected type to phis created for multiple returns.
When inlining, we used to take the type of the inlined method
for the phi in case of multiple returns. I recently changed the
logic of phi types to only be of int/float/double/ref, so we
need to call ToPhiType when creating the phi.
Change-Id: I960067ca8a8814509c2a7c52c08387d892ebf4a3
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc
index e51bbc3..a6adcca 100644
--- a/compiler/optimizing/nodes.cc
+++ b/compiler/optimizing/nodes.cc
@@ -907,7 +907,8 @@
} else {
if (!returns_void) {
// There will be multiple returns.
- return_value = new (allocator) HPhi(allocator, kNoRegNumber, 0, invoke->GetType());
+ return_value = new (allocator) HPhi(
+ allocator, kNoRegNumber, 0, HPhi::ToPhiType(invoke->GetType()));
to->AddPhi(return_value->AsPhi());
}
for (size_t i = 0, e = to->GetPredecessors().Size(); i < e; ++i) {