From 1fc3afb76dbed78d255db276381df6036db2ee98 Mon Sep 17 00:00:00 2001 From: Aart Bik Date: Tue, 2 Feb 2016 13:26:16 -0800 Subject: Minor improvement on static BCE analysis. Rationale: Avoid testing initial range if nothing is known. Change-Id: I22646a5fd6e4481245d1a2f57891d2805550489f --- compiler/optimizing/induction_var_range.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'compiler/optimizing/induction_var_range.cc') diff --git a/compiler/optimizing/induction_var_range.cc b/compiler/optimizing/induction_var_range.cc index ae15fcf381..9566c29adf 100644 --- a/compiler/optimizing/induction_var_range.cc +++ b/compiler/optimizing/induction_var_range.cc @@ -93,7 +93,7 @@ InductionVarRange::InductionVarRange(HInductionVarAnalysis* induction_analysis) DCHECK(induction_analysis != nullptr); } -void InductionVarRange::GetInductionRange(HInstruction* context, +bool InductionVarRange::GetInductionRange(HInstruction* context, HInstruction* instruction, /*out*/Value* min_val, /*out*/Value* max_val, @@ -111,12 +111,9 @@ void InductionVarRange::GetInductionRange(HInstruction* context, *min_val = GetVal(info, trip, in_body, /* is_min */ true); *max_val = SimplifyMax(GetVal(info, trip, in_body, /* is_min */ false)); *needs_finite_test = NeedsTripCount(info) && IsUnsafeTripCount(trip); - } else { - // No loop to analyze. - *min_val = Value(); - *max_val = Value(); - *needs_finite_test = false; + return true; } + return false; // Nothing known } bool InductionVarRange::RefineOuter(/*in-out*/Value* min_val, /*in-out*/Value* max_val) const { -- cgit v1.2.3-59-g8ed1b