Index: src/hydrogen-instructions.cc |
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc |
index 1c3e1f3956d3e7cba96055054d8a2321a54998f2..dc2b6b8276735a2fb9b60cb2a15f52489fa2fc61 100644 |
--- a/src/hydrogen-instructions.cc |
+++ b/src/hydrogen-instructions.cc |
@@ -4497,18 +4497,24 @@ void HPhi::SimplifyConstantInputs() { |
void HPhi::InferRepresentation(HInferRepresentationPhase* h_infer) { |
DCHECK(CheckFlag(kFlexibleRepresentation)); |
- Representation new_rep = RepresentationFromInputs(); |
- UpdateRepresentation(new_rep, h_infer, "inputs"); |
- new_rep = RepresentationFromUses(); |
+ Representation new_rep = RepresentationFromUses(); |
UpdateRepresentation(new_rep, h_infer, "uses"); |
+ new_rep = RepresentationFromInputs(); |
+ UpdateRepresentation(new_rep, h_infer, "inputs"); |
new_rep = RepresentationFromUseRequirements(); |
UpdateRepresentation(new_rep, h_infer, "use requirements"); |
} |
Representation HPhi::RepresentationFromInputs() { |
- Representation r = Representation::None(); |
+ bool has_type_feedback = |
+ smi_non_phi_uses() + int32_non_phi_uses() + double_non_phi_uses() > 0; |
+ Representation r = representation(); |
for (int i = 0; i < OperandCount(); ++i) { |
+ // Ignore conservative Tagged assumption of parameters if we have |
+ // reason to believe that it's too conservative. |
+ if (has_type_feedback && OperandAt(i)->IsParameter()) continue; |
+ |
r = r.generalize(OperandAt(i)->KnownOptimalRepresentation()); |
} |
return r; |