summaryrefslogtreecommitdiff
path: root/compiler/optimizing/loop_optimization.cc
diff options
context:
space:
mode:
authorAart Bik <ajcbik@google.com>2017-04-11 10:15:44 -0700
committerAart Bik <ajcbik@google.com>2017-04-11 10:58:04 -0700
commit3101e58114b21876f77940d716385c54f697761b (patch)
treed0435faf4d2763e24b45fe402aa2155b7d450788 /compiler/optimizing/loop_optimization.cc
parent921c5f9479c83bd1f046213377faf1d2be14e26b (diff)
Fix bug in vectorization of charAt, with regression test
Rationale: String array get instruction cannot be vectorized in a straightforward way, since compression has to be dealt with. So rejected for now. Test: test-art-target, test-art-host Bug: 37151445 Change-Id: I16112cb8b1be30babd8ec07af5976db0369f8c28
Diffstat (limited to 'compiler/optimizing/loop_optimization.cc')
-rw-r--r--compiler/optimizing/loop_optimization.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/optimizing/loop_optimization.cc b/compiler/optimizing/loop_optimization.cc
index 8eeff1f2f0..cf7acb36d1 100644
--- a/compiler/optimizing/loop_optimization.cc
+++ b/compiler/optimizing/loop_optimization.cc
@@ -623,6 +623,12 @@ bool HLoopOptimization::VectorizeUse(LoopNode* node,
}
return true;
} else if (instruction->IsArrayGet()) {
+ // Strings are different, with a different offset to the actual data
+ // and some compressed to save memory. For now, all cases are rejected
+ // to avoid the complexity.
+ if (instruction->AsArrayGet()->IsStringCharAt()) {
+ return false;
+ }
// Accept a right-hand-side array base[index] for
// (1) exact matching vector type,
// (2) loop-invariant base,