From 757b26c2442ae792039bc50153bef91145f3c7b4 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Thu, 29 Jun 2017 16:11:41 +0100 Subject: Add CHECKs to help diagnose a crash seen internally. bug: 62855731 Test: test.py Change-Id: I7904257174ce11a138ca769172dbc2e33e10ef76 --- compiler/optimizing/scheduler.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'compiler/optimizing/scheduler.cc') diff --git a/compiler/optimizing/scheduler.cc b/compiler/optimizing/scheduler.cc index 320f01a727..147fa1c05a 100644 --- a/compiler/optimizing/scheduler.cc +++ b/compiler/optimizing/scheduler.cc @@ -109,6 +109,10 @@ void SchedulingGraph::AddDependencies(HInstruction* instruction, bool is_schedul // barrier depend on it. for (HInstruction* other = instruction->GetNext(); other != nullptr; other = other->GetNext()) { SchedulingNode* other_node = GetNode(other); + CHECK(other_node != nullptr) + << other->DebugName() + << " is in block " << other->GetBlock()->GetBlockId() + << ", and expected in block " << instruction->GetBlock()->GetBlockId(); bool other_is_barrier = other_node->IsSchedulingBarrier(); if (is_scheduling_barrier || other_is_barrier) { AddOtherDependency(other_node, instruction_node); @@ -377,6 +381,10 @@ void HScheduler::Schedule(HBasicBlock* block) { scheduling_graph_.Clear(); for (HBackwardInstructionIterator it(block->GetInstructions()); !it.Done(); it.Advance()) { HInstruction* instruction = it.Current(); + CHECK_EQ(instruction->GetBlock(), block) + << instruction->DebugName() + << " is in block " << instruction->GetBlock()->GetBlockId() + << ", and expected in block " << block->GetBlockId(); SchedulingNode* node = scheduling_graph_.AddNode(instruction, IsSchedulingBarrier(instruction)); CalculateLatency(node); scheduling_nodes.push_back(node); -- cgit v1.2.3-59-g8ed1b