Commit bb886feb authored by mmassi@chromium.org's avatar mmassi@chromium.org

Remove purely informative definitions from the graph.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13696 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent c6e67092
......@@ -819,6 +819,11 @@ class HValue: public ZoneObject {
: NULL;
}
// A purely informative definition is an idef that will not emit code and
// should therefore be removed from the graph in the RestoreActualValues
// phase (so that live ranges will be shorter).
virtual bool IsPurelyInformativeDefinition() { return false; }
// This method must always return the original HValue SSA definition
// (regardless of any iDef of this value).
HValue* ActualValue() {
......@@ -1286,6 +1291,7 @@ class HNumericConstraint : public HTemplateInstruction<2> {
NumericRelation relation() { return relation_; }
virtual int RedefinedOperandIndex() { return 0; }
virtual bool IsPurelyInformativeDefinition() { return true; }
virtual Representation RequiredInputRepresentation(int index) {
return representation();
......@@ -3363,6 +3369,7 @@ class HBoundsCheck: public HTemplateInstruction<2> {
HValue* length() { return OperandAt(1); }
virtual int RedefinedOperandIndex() { return 0; }
virtual bool IsPurelyInformativeDefinition() { return skip_check(); }
virtual void AddInformativeDefinitions();
DECLARE_CONCRETE_INSTRUCTION(BoundsCheck)
......
......@@ -4384,7 +4384,12 @@ void HGraph::RestoreActualValues() {
instruction != NULL;
instruction = instruction->next()) {
if (instruction->ActualValue() != instruction) {
instruction->ReplaceAllUsesWith(instruction->ActualValue());
ASSERT(instruction->IsInformativeDefinition());
if (instruction->IsPurelyInformativeDefinition()) {
instruction->DeleteAndReplaceWith(instruction->RedefinedOperand());
} else {
instruction->ReplaceAllUsesWith(instruction->ActualValue());
}
}
}
}
......
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