: 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() {
NumericRelation relation() { return relation_; }
virtual int RedefinedOperandIndex() { return 0; }
+ virtual bool IsPurelyInformativeDefinition() { return true; }
virtual Representation RequiredInputRepresentation(int index) {
return representation();
HValue* length() { return OperandAt(1); }
virtual int RedefinedOperandIndex() { return 0; }
+ virtual bool IsPurelyInformativeDefinition() { return skip_check(); }
virtual void AddInformativeDefinitions();
DECLARE_CONCRETE_INSTRUCTION(BoundsCheck)
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());
+ }
}
}
}