diff options
author | 2019-07-25 21:04:16 +0100 | |
---|---|---|
committer | 2019-07-31 08:16:27 +0000 | |
commit | e65ade70584728c544c8db5a4e0a729750813380 (patch) | |
tree | bf25c31f699f29a54f0e7dc976ab73925b12aa61 /compiler/optimizing/loop_optimization.cc | |
parent | 9df37b9f0fc2046ceabeea0d0638ac286bfc0f37 (diff) |
ART: Disable vectorization for debuggable graphs.
SuspendCheck environment is incorrectly initialized with
a stale version of the loop induction variable (a pre-loop one)
for vectorized loops. The value can be retrieved from a
corresponding stack maps only in case of asynchronous
deoptimization in debuggable mode. Thus this workaround forbids
loop optimizations on debuggable graphs so the bug is never
triggered.
Test: test-art-target, test-art-host.
Bug: 138601207
Change-Id: Ica9f61f471c024146b7823214ef952e1db2a4663
Diffstat (limited to 'compiler/optimizing/loop_optimization.cc')
-rw-r--r-- | compiler/optimizing/loop_optimization.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/optimizing/loop_optimization.cc b/compiler/optimizing/loop_optimization.cc index 99141279bc..3e1c42c8d9 100644 --- a/compiler/optimizing/loop_optimization.cc +++ b/compiler/optimizing/loop_optimization.cc @@ -763,6 +763,11 @@ bool HLoopOptimization::TryOptimizeInnerLoopFinite(LoopNode* node) { } // Vectorize loop, if possible and valid. if (kEnableVectorization && + // Disable vectorization for debuggable graphs: this is a workaround for the bug + // in 'GenerateNewLoop' which caused the SuspendCheck environment to be invalid. + // TODO: b/138601207, investigate other possible cases with wrong environment values and + // possibly switch back vectorization on for debuggable graphs. + !graph_->IsDebuggable() && TrySetSimpleLoopHeader(header, &main_phi) && ShouldVectorize(node, body, trip_count) && TryAssignLastValue(node->loop_info, main_phi, preheader, /*collect_loop_uses*/ true)) { |