From 389b3dbf5c5390056ff4dacac464219853dd3cda Mon Sep 17 00:00:00 2001 From: Aart Bik Date: Wed, 28 Oct 2015 14:23:40 -0700 Subject: Finalized all components of range analysis needed for dynamic bce. Rationale: added ability to generate taken-test, prompt back need for finite-test; cleaned up the API now that bounds check needs are all known. Change-Id: I3d09b249965d1a980c09381240de175ca4b2e455 --- compiler/optimizing/bounds_check_elimination.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/bounds_check_elimination.cc') diff --git a/compiler/optimizing/bounds_check_elimination.cc b/compiler/optimizing/bounds_check_elimination.cc index bcc32403d3..cca0baf274 100644 --- a/compiler/optimizing/bounds_check_elimination.cc +++ b/compiler/optimizing/bounds_check_elimination.cc @@ -1169,8 +1169,10 @@ class BCEVisitor : public HGraphVisitor { // Return the range resulting from induction variable analysis of "instruction" when the value // is used from "context", for example, an index used from a bounds-check inside a loop body. ValueRange* LookupInductionRange(HInstruction* context, HInstruction* instruction) { - InductionVarRange::Value v1 = induction_range_.GetMinInduction(context, instruction); - InductionVarRange::Value v2 = induction_range_.GetMaxInduction(context, instruction); + InductionVarRange::Value v1; + InductionVarRange::Value v2; + bool needs_finite_test = false; + induction_range_.GetInductionRange(context, instruction, &v1, &v2, &needs_finite_test); if (v1.is_known && (v1.a_constant == 0 || v1.a_constant == 1) && v2.is_known && (v2.a_constant == 0 || v2.a_constant == 1)) { DCHECK(v1.a_constant == 1 || v1.instruction == nullptr); -- cgit v1.2.3-59-g8ed1b