diff options
author | 2017-08-30 10:20:47 -0700 | |
---|---|---|
committer | 2017-08-30 10:52:33 -0700 | |
commit | 7f56ff42ac663ccfa62034ed22297bd7d9bce2f6 (patch) | |
tree | 257b52e881647dc28be8999ecdcc38bc4ec7052a /compiler/optimizing/induction_var_range.cc | |
parent | bdd827280a787c359961caf990f4a2c6e57810c1 (diff) |
Refined range rule for ABS(x)
Rationale;
ABS(minint) = minint prevents assuming >=0 always.
With a fail-before(sig11)/pass-after regression test.
Test: 623
Change-Id: If5fb1580b207c7cdd964f7498849d1768bb1589d
Diffstat (limited to 'compiler/optimizing/induction_var_range.cc')
-rw-r--r-- | compiler/optimizing/induction_var_range.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/optimizing/induction_var_range.cc b/compiler/optimizing/induction_var_range.cc index f35aace3a9..089340e715 100644 --- a/compiler/optimizing/induction_var_range.cc +++ b/compiler/optimizing/induction_var_range.cc @@ -87,8 +87,10 @@ static bool IsGEZero(HInstruction* instruction) { IsGEZero(instruction->InputAt(1)); case Intrinsics::kMathAbsInt: case Intrinsics::kMathAbsLong: - // Instruction ABS(x) is >= 0. - return true; + // Instruction ABS(>=0) is >= 0. + // NOTE: ABS(minint) = minint prevents assuming + // >= 0 without looking at the argument. + return IsGEZero(instruction->InputAt(0)); default: break; } |