summaryrefslogtreecommitdiff
path: root/compiler/optimizing/bounds_check_elimination.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2016-01-14 21:25:16 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2016-01-14 21:25:16 +0000
commit947cb4f5582d1f57270b48d3c47ea95e7f9085b5 (patch)
tree6f6aed8f8cca3177b06521a8db6ca845d18623ad /compiler/optimizing/bounds_check_elimination.cc
parent7b4199a5fa9f151fbf3af2a34f26d04215a1016c (diff)
parent15bd22849ee6a1ffb3fb3630f686c2870bdf1bbc (diff)
Merge "Implement irreducible loop support in optimizing."
Diffstat (limited to 'compiler/optimizing/bounds_check_elimination.cc')
-rw-r--r--compiler/optimizing/bounds_check_elimination.cc7
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;
}