From e65ade70584728c544c8db5a4e0a729750813380 Mon Sep 17 00:00:00 2001 From: Artem Serov Date: Thu, 25 Jul 2019 21:04:16 +0100 Subject: 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 --- compiler/optimizing/loop_optimization.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'compiler/optimizing/loop_optimization.cc') 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)) { -- cgit v1.2.3-59-g8ed1b