From 8554449e311e50f2e96db1081a17ccf7151ef7f6 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 16 Jan 2009 21:37:14 +0000 Subject: [PATCH] Fix the check for an empty basic block to check for an empty SUnits array instead, since this is what the scheduler actually cares about. And remove a check that is unnecessary, since it can assume that SUnits isn't empty. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62362 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/PostRASchedulerList.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/PostRASchedulerList.cpp b/lib/CodeGen/PostRASchedulerList.cpp index b7bfe3fefd9..12d9efa87b4 100644 --- a/lib/CodeGen/PostRASchedulerList.cpp +++ b/lib/CodeGen/PostRASchedulerList.cpp @@ -264,7 +264,7 @@ static SDep *CriticalPathStep(SUnit *SU) { bool SchedulePostRATDList::BreakAntiDependencies() { // The code below assumes that there is at least one instruction, // so just duck out immediately if the block is empty. - if (BB->empty()) return false; + if (SUnits.empty()) return false; // Find the node at the bottom of the critical path. SUnit *Max = 0; @@ -275,7 +275,7 @@ bool SchedulePostRATDList::BreakAntiDependencies() { } DOUT << "Critical path has total latency " - << (Max ? Max->getDepth() + Max->Latency : 0) << "\n"; + << (Max->getDepth() + Max->Latency) << "\n"; // Track progress along the critical path through the SUnit graph as we walk // the instructions. -- 2.34.1