diff options
| author | 2015-06-24 14:10:57 +0000 | |
|---|---|---|
| committer | 2015-06-24 14:10:58 +0000 | |
| commit | 2b1bc487d3fa84e4bac16e85112e5e45682ac0ba (patch) | |
| tree | 3b9ebc758d870b126b76bf681ed913b773d67667 /compiler/optimizing | |
| parent | b809daaffdd42dc01457ae06ae83f2d7ebdb5e65 (diff) | |
| parent | a09ff9c11f07863ac57e6120a824f0d20dfaa284 (diff) | |
Merge "BCE: Narrow instead of unconditionnaly overwrite the range."
Diffstat (limited to 'compiler/optimizing')
| -rw-r--r-- | compiler/optimizing/bounds_check_elimination.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/optimizing/bounds_check_elimination.cc b/compiler/optimizing/bounds_check_elimination.cc index 900dabea0e..92c7e28e97 100644 --- a/compiler/optimizing/bounds_check_elimination.cc +++ b/compiler/optimizing/bounds_check_elimination.cc @@ -1180,9 +1180,7 @@ class BCEVisitor : public HGraphVisitor { } } ValueRange* narrowed_range = existing_range->Narrow(range); - if (narrowed_range != nullptr) { - GetValueRangeMap(successor)->Overwrite(instruction->GetId(), narrowed_range); - } + GetValueRangeMap(successor)->Overwrite(instruction->GetId(), narrowed_range); } // Special case that we may simultaneously narrow two MonotonicValueRange's to @@ -1730,6 +1728,10 @@ class BCEVisitor : public HGraphVisitor { ValueBound upper = ValueBound(new_array, -right_const); ValueRange* range = new (GetGraph()->GetArena()) ValueRange(GetGraph()->GetArena(), lower, upper); + ValueRange* existing_range = LookupValueRange(left, new_array->GetBlock()); + if (existing_range != nullptr) { + range = existing_range->Narrow(range); + } GetValueRangeMap(new_array->GetBlock())->Overwrite(left->GetId(), range); } } |