diff options
Diffstat (limited to 'compiler/optimizing/bounds_check_elimination.cc')
-rw-r--r-- | compiler/optimizing/bounds_check_elimination.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/optimizing/bounds_check_elimination.cc b/compiler/optimizing/bounds_check_elimination.cc index d710747e76..eee6116098 100644 --- a/compiler/optimizing/bounds_check_elimination.cc +++ b/compiler/optimizing/bounds_check_elimination.cc @@ -1296,8 +1296,13 @@ class BCEVisitor : public HGraphVisitor { */ bool DynamicBCESeemsProfitable(HLoopInformation* loop, HBasicBlock* block) { if (loop != nullptr) { + // The loop preheader of an irreducible loop does not dominate all the blocks in + // the loop. We would need to find the common dominator of all blocks in the loop. + if (loop->IsIrreducible()) { + return false; + } // A try boundary preheader is hard to handle. - // TODO: remove this restriction + // TODO: remove this restriction. if (loop->GetPreHeader()->GetLastInstruction()->IsTryBoundary()) { return false; } |