summaryrefslogtreecommitdiff
path: root/compiler/optimizing/induction_var_range.cc
diff options
context:
space:
mode:
author Aart Bik <ajcbik@google.com> 2016-02-02 13:26:16 -0800
committer Aart Bik <ajcbik@google.com> 2016-02-03 09:22:27 -0800
commit1fc3afb76dbed78d255db276381df6036db2ee98 (patch)
tree61ee6429e39fad5ae5d5d6d620966ce90fead39c /compiler/optimizing/induction_var_range.cc
parent97f4bc04b61d5cf78b0820dbf18e999b20d7a108 (diff)
Minor improvement on static BCE analysis.
Rationale: Avoid testing initial range if nothing is known. Change-Id: I22646a5fd6e4481245d1a2f57891d2805550489f
Diffstat (limited to 'compiler/optimizing/induction_var_range.cc')
-rw-r--r--compiler/optimizing/induction_var_range.cc9
1 files changed, 3 insertions, 6 deletions
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 {