Commit 76aab824 authored by jkummerow's avatar jkummerow Committed by Commit bot

Reduce impact of HParameter inputs on HPhi representation selection

This is a follow-up to r25153.

BUG=v8:3766
LOG=n

Review URL: https://codereview.chromium.org/807273003

Cr-Commit-Position: refs/heads/master@{#25885}
parent 70eb456e
......@@ -4501,18 +4501,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;
......
......@@ -1641,6 +1641,11 @@ class HForceRepresentation FINAL : public HTemplateInstruction<1> {
HValue* value() const { return OperandAt(0); }
Representation observed_input_representation(int index) OVERRIDE {
// We haven't actually *observed* this, but it's closer to the truth
// than 'None'.
return representation(); // Same as the output representation.
}
Representation RequiredInputRepresentation(int index) OVERRIDE {
return representation(); // Same as the output representation.
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment