summaryrefslogtreecommitdiff
path: root/compiler/optimizing/induction_var_range.h
diff options
context:
space:
mode:
author Aart Bik <ajcbik@google.com> 2015-12-03 11:23:35 -0800
committer Aart Bik <ajcbik@google.com> 2015-12-03 16:42:17 -0800
commitb738d4f477a9b6f4c4f69153f9077f1559d2bca1 (patch)
tree53c1100c03c33039e910e0e97ca4ef73d69bb15f /compiler/optimizing/induction_var_range.h
parent68cebffee2f44f0345bd7be7e4cbad0f10e64082 (diff)
Step-wise improvement of range analysis with outer loop induction.
Rationale: Using a step-wise approach (rather than expanding all ranges at once) increases the opportunities for statically removing bound checks, as demonstrated by the new checker tests. Change-Id: Icbfd9406523a069e1fb7508546ea94f896e5a255
Diffstat (limited to 'compiler/optimizing/induction_var_range.h')
-rw-r--r--compiler/optimizing/induction_var_range.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/optimizing/induction_var_range.h b/compiler/optimizing/induction_var_range.h
index 7984871b08..71b0b1b4c3 100644
--- a/compiler/optimizing/induction_var_range.h
+++ b/compiler/optimizing/induction_var_range.h
@@ -68,6 +68,9 @@ class InductionVarRange {
/*out*/Value* max_val,
/*out*/bool* needs_finite_test);
+ /** Refines the values with induction of next outer loop. Returns true on change. */
+ bool RefineOuter(/*in-out*/Value* min_val, /*in-out*/Value* max_val);
+
/**
* Returns true if range analysis is able to generate code for the lower and upper
* bound expressions on the instruction in the given context. The need_finite_test
@@ -149,6 +152,12 @@ class InductionVarRange {
static Value MergeVal(Value v1, Value v2, bool is_min);
/**
+ * Returns refined value using induction of next outer loop or the input value if no
+ * further refinement is possible.
+ */
+ Value RefineOuter(Value val, bool is_min);
+
+ /**
* Generates code for lower/upper/taken-test in the HIR. Returns true on success.
* With values nullptr, the method can be used to determine if code generation
* would be successful without generating actual code yet.