From 1a0a519c82044ec3e6d3910ff0602b11292de47a Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Thu, 22 Jun 2017 11:56:01 +0100 Subject: Fix loop optimization in the presence of environment uses. We should not remove instructions that have deoptimize as users, or that have environment uses in a debuggable setup. bug: 62536525 bug: 33775412 Test: 656-loop-deopt Change-Id: Iaec1a0b6e90c6a0169f18c6985f00fd8baf2dece --- compiler/optimizing/loop_optimization.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'compiler/optimizing/loop_optimization.h') diff --git a/compiler/optimizing/loop_optimization.h b/compiler/optimizing/loop_optimization.h index 75a42f3297..cc6343aeb5 100644 --- a/compiler/optimizing/loop_optimization.h +++ b/compiler/optimizing/loop_optimization.h @@ -161,12 +161,15 @@ class HLoopOptimization : public HOptimization { /*out*/ int32_t* use_count); bool IsUsedOutsideLoop(HLoopInformation* loop_info, HInstruction* instruction); - bool TryReplaceWithLastValue(HInstruction* instruction, HBasicBlock* block); + bool TryReplaceWithLastValue(HLoopInformation* loop_info, + HInstruction* instruction, + HBasicBlock* block); bool TryAssignLastValue(HLoopInformation* loop_info, HInstruction* instruction, HBasicBlock* block, bool collect_loop_uses); void RemoveDeadInstructions(const HInstructionList& list); + bool CanRemoveCycle(); // Whether the current 'iset_' is removable. // Compiler driver (to query ISA features). const CompilerDriver* compiler_driver_; -- cgit v1.2.3-59-g8ed1b