From 3cde6227678cf62e06bca264671d1e957456ac3d Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Wed, 17 Jun 2015 10:17:49 +0100 Subject: Remove bogus DCHECK in BCE. When creating a phi for the array length when we add HDeoptimization nodes, we might update accesses in inner loops to use that phi instead of the array length. The BCE phase was not expecting this case. Change-Id: I639f4ea6f5889726142041a42736183f162c7437 --- compiler/optimizing/bounds_check_elimination.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'compiler/optimizing/bounds_check_elimination.cc') diff --git a/compiler/optimizing/bounds_check_elimination.cc b/compiler/optimizing/bounds_check_elimination.cc index 9d5e3fdca1..97b3725da1 100644 --- a/compiler/optimizing/bounds_check_elimination.cc +++ b/compiler/optimizing/bounds_check_elimination.cc @@ -335,12 +335,12 @@ class ArrayAccessInsideLoopFinder : public ValueObject { continue; } - DCHECK(!length_value->IsPhi()); if (length_value->IsPhi()) { - // Outer loop shouldn't collect bounds checks inside inner - // loop because the inner loop body doen't dominate - // outer loop's back edges. However just to be on the safe side, - // if there are any such cases, we just skip over them. + // When adding deoptimizations in outer loops, we might create + // a phi for the array length, and update all uses of the + // length in the loop to that phi. Therefore, inner loops having + // bounds checks on the same array will use that phi. + // TODO: handle these cases. continue; } -- cgit v1.2.3-59-g8ed1b