diff options
Diffstat (limited to 'compiler/optimizing/instruction_simplifier.cc')
-rw-r--r-- | compiler/optimizing/instruction_simplifier.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/optimizing/instruction_simplifier.cc b/compiler/optimizing/instruction_simplifier.cc index 94b201e876..5d552411db 100644 --- a/compiler/optimizing/instruction_simplifier.cc +++ b/compiler/optimizing/instruction_simplifier.cc @@ -2406,7 +2406,9 @@ static bool IsArrayLengthOf(HInstruction* potential_length, HInstruction* potent void InstructionSimplifierVisitor::SimplifySystemArrayCopy(HInvoke* instruction) { HInstruction* source = instruction->InputAt(0); + HInstruction* source_pos = instruction->InputAt(1); HInstruction* destination = instruction->InputAt(2); + HInstruction* destination_pos = instruction->InputAt(3); HInstruction* count = instruction->InputAt(4); SystemArrayCopyOptimizations optimizations(instruction); if (CanEnsureNotNullAt(source, instruction)) { @@ -2419,6 +2421,10 @@ void InstructionSimplifierVisitor::SimplifySystemArrayCopy(HInvoke* instruction) optimizations.SetDestinationIsSource(); } + if (source_pos == destination_pos) { + optimizations.SetSourcePositionIsDestinationPosition(); + } + if (IsArrayLengthOf(count, source)) { optimizations.SetCountIsSourceLength(); } |