From 7040d6e2f5d503e9948b9caff940a66238a0c605 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Thu, 5 Nov 2009 21:06:09 +0000 Subject: [PATCH] Fix bug in aggressive antidep breaking; liveness was not updated correctly for regions that do not have antidep candidates. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86172 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AggressiveAntiDepBreaker.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/CodeGen/AggressiveAntiDepBreaker.cpp b/lib/CodeGen/AggressiveAntiDepBreaker.cpp index 86d051c102f..c10900c18d6 100644 --- a/lib/CodeGen/AggressiveAntiDepBreaker.cpp +++ b/lib/CodeGen/AggressiveAntiDepBreaker.cpp @@ -630,12 +630,6 @@ unsigned AggressiveAntiDepBreaker::BreakAntiDependencies( std::multimap& RegRefs = State->GetRegRefs(); - // Nothing to do if no candidates. - if (Candidates.empty()) { - DEBUG(errs() << "\n===== No anti-dependency candidates\n"); - return 0; - } - // The code below assumes that there is at least one instruction, // so just duck out immediately if the block is empty. if (SUnits.empty()) return 0; @@ -655,16 +649,19 @@ unsigned AggressiveAntiDepBreaker::BreakAntiDependencies( // ...need a map from MI to SUnit. std::map MISUnitMap; - - DEBUG(errs() << "\n===== Attempting to break " << Candidates.size() << - " anti-dependencies\n"); for (unsigned i = 0, e = SUnits.size(); i != e; ++i) { SUnit *SU = &SUnits[i]; MISUnitMap.insert(std::pair(SU->getInstr(), SU)); } + // Even if there are no anti-dependencies we still need to go + // through the instructions to update Def, Kills, etc. #ifndef NDEBUG - { + if (Candidates.empty()) { + DEBUG(errs() << "\n===== No anti-dependency candidates\n"); + } else { + DEBUG(errs() << "\n===== Attempting to break " << Candidates.size() << + " anti-dependencies\n"); DEBUG(errs() << "Available regs:"); for (unsigned Reg = 0; Reg < TRI->getNumRegs(); ++Reg) { if (!State->IsLive(Reg))