diff options
author | Roland Levillain <rpl@google.com> | 2014-09-23 17:13:54 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-09-23 17:13:55 +0000 |
commit | f038ed9f031acb9c4fdf8a7f86e3c7ffad537e37 (patch) | |
tree | 82c4903f0949d8732eb46bb96c58482f1af25128 /compiler/optimizing | |
parent | 92822f4052629395eb1aa1a1253440b9c3ebad6c (diff) | |
parent | 7e53b415e5e587cd7961978f6da7347248f40b29 (diff) | |
download | art-f038ed9f031acb9c4fdf8a7f86e3c7ffad537e37.zip art-f038ed9f031acb9c4fdf8a7f86e3c7ffad537e37.tar.gz art-f038ed9f031acb9c4fdf8a7f86e3c7ffad537e37.tar.bz2 |
Merge "Optimizing compiler: ensure loop header dominates loop's blocks."
Diffstat (limited to 'compiler/optimizing')
-rw-r--r-- | compiler/optimizing/graph_checker.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc index b05090b..e36b1cd 100644 --- a/compiler/optimizing/graph_checker.cc +++ b/compiler/optimizing/graph_checker.cc @@ -20,6 +20,8 @@ #include <map> #include <sstream> +#include "base/bit_vector-inl.h" + namespace art { void GraphChecker::VisitBasicBlock(HBasicBlock* block) { @@ -212,6 +214,19 @@ void SSAChecker::CheckLoop(HBasicBlock* loop_header) { << num_back_edges << " back edge(s)."; errors_.Insert(error.str()); } + + // Ensure all blocks in the loop are dominated by the loop header. + const ArenaBitVector& loop_blocks = + loop_header->GetLoopInformation()->GetBlocks(); + for (uint32_t i : loop_blocks.Indexes()) { + HBasicBlock* loop_block = GetGraph()->GetBlocks().Get(i); + if (!loop_header->Dominates(loop_block)) { + std::stringstream error; + error << "Loop block " << loop_block->GetBlockId() + << " not dominated by loop header " << id; + errors_.Insert(error.str()); + } + } } void SSAChecker::VisitInstruction(HInstruction* instruction) { |