diff options
Diffstat (limited to 'compiler/optimizing')
-rw-r--r-- | compiler/optimizing/codegen_test.cc | 1 | ||||
-rw-r--r-- | compiler/optimizing/nodes.h | 10 | ||||
-rw-r--r-- | compiler/optimizing/register_allocator_test.cc | 6 |
3 files changed, 15 insertions, 2 deletions
diff --git a/compiler/optimizing/codegen_test.cc b/compiler/optimizing/codegen_test.cc index 868fc5b867..40f0adc63d 100644 --- a/compiler/optimizing/codegen_test.cc +++ b/compiler/optimizing/codegen_test.cc @@ -145,6 +145,7 @@ static void RunCodeOptimized(CodeGenerator* codegen, std::function<void(HGraph*)> hook_before_codegen, bool has_result, Expected expected) { + graph->BuildDominatorTree(); SsaLivenessAnalysis liveness(*graph, codegen); liveness.Analyze(); diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 97ade0dc62..db7873b14e 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -3483,7 +3483,10 @@ class HInsertionOrderIterator : public ValueObject { class HReversePostOrderIterator : public ValueObject { public: - explicit HReversePostOrderIterator(const HGraph& graph) : graph_(graph), index_(0) {} + explicit HReversePostOrderIterator(const HGraph& graph) : graph_(graph), index_(0) { + // Check that reverse post order of the graph has been built. + DCHECK(!graph.GetReversePostOrder().IsEmpty()); + } bool Done() const { return index_ == graph_.GetReversePostOrder().Size(); } HBasicBlock* Current() const { return graph_.GetReversePostOrder().Get(index_); } @@ -3499,7 +3502,10 @@ class HReversePostOrderIterator : public ValueObject { class HPostOrderIterator : public ValueObject { public: explicit HPostOrderIterator(const HGraph& graph) - : graph_(graph), index_(graph_.GetReversePostOrder().Size()) {} + : graph_(graph), index_(graph_.GetReversePostOrder().Size()) { + // Check that reverse post order of the graph has been built. + DCHECK(!graph.GetReversePostOrder().IsEmpty()); + } bool Done() const { return index_ == 0; } HBasicBlock* Current() const { return graph_.GetReversePostOrder().Get(index_ - 1); } diff --git a/compiler/optimizing/register_allocator_test.cc b/compiler/optimizing/register_allocator_test.cc index b757a3b9b9..7a2d84b056 100644 --- a/compiler/optimizing/register_allocator_test.cc +++ b/compiler/optimizing/register_allocator_test.cc @@ -596,6 +596,8 @@ static HGraph* BuildFieldReturn(ArenaAllocator* allocator, graph->AddBlock(exit); block->AddSuccessor(exit); exit->AddInstruction(new (allocator) HExit()); + + graph->BuildDominatorTree(); return graph; } @@ -658,6 +660,8 @@ static HGraph* BuildTwoSubs(ArenaAllocator* allocator, block->AddInstruction(*second_sub); block->AddInstruction(new (allocator) HExit()); + + graph->BuildDominatorTree(); return graph; } @@ -719,6 +723,8 @@ static HGraph* BuildDiv(ArenaAllocator* allocator, block->AddInstruction(*div); block->AddInstruction(new (allocator) HExit()); + + graph->BuildDominatorTree(); return graph; } |