From 3101e58114b21876f77940d716385c54f697761b Mon Sep 17 00:00:00 2001 From: Aart Bik Date: Tue, 11 Apr 2017 10:15:44 -0700 Subject: 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 --- compiler/optimizing/loop_optimization.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'compiler/optimizing/loop_optimization.cc') 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, -- cgit v1.2.3-59-g8ed1b