summaryrefslogtreecommitdiff
path: root/compiler/optimizing/induction_var_range.h
diff options
context:
space:
mode:
author Aart Bik <ajcbik@google.com> 2017-04-07 11:33:37 -0700
committer Aart Bik <ajcbik@google.com> 2017-04-07 23:03:42 +0000
commitfa76296bc624bc2c879167c260ad6925238efb3d (patch)
tree045c4488fec66806982a62aa4cfd7d3a2183e958 /compiler/optimizing/induction_var_range.h
parent6f005931d0a0db65128db803df38d59d205dd218 (diff)
Fixed missing context while detecting unit strides.
With regression test (found by fuzz testing). Bug: 37033123 Test: test-art-target Change-Id: Id738b2a3a353985c3d0bf3beeb581a31f1fcbc3f
Diffstat (limited to 'compiler/optimizing/induction_var_range.h')
-rw-r--r--compiler/optimizing/induction_var_range.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler/optimizing/induction_var_range.h b/compiler/optimizing/induction_var_range.h
index 0858d73982..a8ee829d08 100644
--- a/compiler/optimizing/induction_var_range.h
+++ b/compiler/optimizing/induction_var_range.h
@@ -156,10 +156,14 @@ class InductionVarRange {
bool IsFinite(HLoopInformation* loop, /*out*/ int64_t* tc) const;
/**
- * Checks if instruction is a unit stride induction inside the closest enveloping loop.
- * Returns invariant offset on success.
+ * Checks if the given instruction is a unit stride induction inside the closest enveloping
+ * loop of the context that is defined by the first parameter (e.g. pass an array reference
+ * as context and the index as instruction to make sure the stride is tested against the
+ * loop that envelops the reference the closest). Returns invariant offset on success.
*/
- bool IsUnitStride(HInstruction* instruction, /*out*/ HInstruction** offset) const;
+ bool IsUnitStride(HInstruction* context,
+ HInstruction* instruction,
+ /*out*/ HInstruction** offset) const;
/**
* Generates the trip count expression for the given loop. Code is generated in given block