summaryrefslogtreecommitdiff
path: root/compiler/optimizing/graph_checker.cc
diff options
context:
space:
mode:
author David Brazdil <dbrazdil@google.com> 2015-04-21 16:36:35 +0100
committer David Brazdil <dbrazdil@google.com> 2015-04-21 17:17:11 +0100
commit7d275379bf490a87805852129e3fe2e8afe961e7 (patch)
treed0bbe856872c92773931c62e6881b0305a916236 /compiler/optimizing/graph_checker.cc
parent223f2f5b2a20ca8246da1523494900a2424d5956 (diff)
ART: Update loop info of all nested loops when inlining
When inlining into a nested loop, the inliner would only add the new blocks into the innermost loop info object. This patch fixes that and modifies SsaChecker to verify the property. Change-Id: I21d343a6f7d972f5b7420701f816c65ab3f20566
Diffstat (limited to 'compiler/optimizing/graph_checker.cc')
-rw-r--r--compiler/optimizing/graph_checker.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc
index 2216cecc2b..e743d8eca8 100644
--- a/compiler/optimizing/graph_checker.cc
+++ b/compiler/optimizing/graph_checker.cc
@@ -276,6 +276,17 @@ void SSAChecker::CheckLoop(HBasicBlock* loop_header) {
id));
}
}
+
+ // If this is a nested loop, ensure the outer loops contain a superset of the blocks.
+ for (HLoopInformationOutwardIterator it(*loop_header); !it.Done(); it.Advance()) {
+ HLoopInformation* outer_info = it.Current();
+ if (!loop_blocks.IsSubsetOf(&outer_info->GetBlocks())) {
+ AddError(StringPrintf("Blocks of loop defined by header %d are not a subset of blocks of "
+ "an outer loop defined by header %d.",
+ loop_header->GetBlockId(),
+ outer_info->GetHeader()->GetBlockId()));
+ }
+ }
}
void SSAChecker::VisitInstruction(HInstruction* instruction) {