Index: src/compiler/simplified-lowering.cc |
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc |
index 960c93aaba1e583bd895f0a424c82d2b7034f404..a635f98314dc5e4a1a3358dbccee9499dadac700 100644 |
--- a/src/compiler/simplified-lowering.cc |
+++ b/src/compiler/simplified-lowering.cc |
@@ -267,7 +267,8 @@ class RepresentationSelector { |
void VisitUint64Cmp(Node* node) { VisitBinop(node, kMachUint64, kRepBit); } |
// Helper for handling phis. |
- void VisitPhi(Node* node, MachineTypeUnion use) { |
+ void VisitPhi(Node* node, MachineTypeUnion use, |
+ SimplifiedLowering* lowering) { |
// First, propagate the usage information to inputs of the phi. |
if (!lower()) { |
int values = OperatorProperties::GetValueInputCount(node->op()); |
@@ -318,6 +319,13 @@ class RepresentationSelector { |
if (lower()) { |
int values = OperatorProperties::GetValueInputCount(node->op()); |
+ |
+ // Update the phi operator. |
+ MachineType type = static_cast<MachineType>(output_type); |
+ if (type != OpParameter<MachineType>(node)) { |
+ node->set_op(lowering->common()->Phi(type, values)); |
+ } |
+ |
// Convert inputs to the output representation of this phi. |
Node::Inputs inputs = node->inputs(); |
for (Node::Inputs::iterator iter(inputs.begin()); iter != inputs.end(); |
@@ -384,7 +392,7 @@ class RepresentationSelector { |
Enqueue(NodeProperties::GetControlInput(node, 0)); |
break; |
case IrOpcode::kPhi: |
- return VisitPhi(node, use); |
+ return VisitPhi(node, use, lowering); |
//------------------------------------------------------------------ |
// JavaScript operators. |