summaryrefslogtreecommitdiff
path: root/compiler/optimizing/loop_optimization.cc
diff options
context:
space:
mode:
authorAart Bik <ajcbik@google.com>2017-04-07 11:33:37 -0700
committerAart Bik <ajcbik@google.com>2017-04-07 23:03:42 +0000
commitfa76296bc624bc2c879167c260ad6925238efb3d (patch)
tree045c4488fec66806982a62aa4cfd7d3a2183e958 /compiler/optimizing/loop_optimization.cc
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/loop_optimization.cc')
-rw-r--r--compiler/optimizing/loop_optimization.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/optimizing/loop_optimization.cc b/compiler/optimizing/loop_optimization.cc
index 1a79601a93..bf18cc9bbc 100644
--- a/compiler/optimizing/loop_optimization.cc
+++ b/compiler/optimizing/loop_optimization.cc
@@ -580,7 +580,7 @@ bool HLoopOptimization::VectorizeDef(LoopNode* node,
HInstruction* offset = nullptr;
if (TrySetVectorType(type, &restrictions) &&
node->loop_info->IsDefinedOutOfTheLoop(base) &&
- induction_range_.IsUnitStride(index, &offset) &&
+ induction_range_.IsUnitStride(instruction, index, &offset) &&
VectorizeUse(node, value, generate_code, type, restrictions)) {
if (generate_code) {
GenerateVecSub(index, offset);
@@ -633,7 +633,7 @@ bool HLoopOptimization::VectorizeUse(LoopNode* node,
HInstruction* offset = nullptr;
if (type == instruction->GetType() &&
node->loop_info->IsDefinedOutOfTheLoop(base) &&
- induction_range_.IsUnitStride(index, &offset)) {
+ induction_range_.IsUnitStride(instruction, index, &offset)) {
if (generate_code) {
GenerateVecSub(index, offset);
GenerateVecMem(instruction, vector_map_->Get(index), nullptr, type);