From 0195826998b1c1bfcc121a40d09e59dbbd46bc3f Mon Sep 17 00:00:00 2001 From: Quentin Colombet Date: Tue, 5 Apr 2016 21:47:56 +0000 Subject: [PATCH] [RegisterBankInfo] Add debug print to check how the initialization is going. llvm-svn: 265475 --- llvm/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/llvm/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp b/llvm/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp index 80c0b0380bee..58e63a23517c 100644 --- a/llvm/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp +++ b/llvm/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp @@ -13,6 +13,7 @@ #include "llvm/CodeGen/GlobalISel/RegisterBank.h" #include "llvm/ADT/SmallVector.h" #include "llvm/CodeGen/GlobalISel/RegisterBankInfo.h" +#include "llvm/Support/Debug.h" #include "llvm/Target/TargetRegisterInfo.h" #include // For std::max. @@ -33,11 +34,14 @@ void RegisterBankInfo::verify(const TargetRegisterInfo &TRI) const { const RegisterBank &RegBank = getRegBank(Idx); assert(Idx == RegBank.getID() && "ID does not match the index in the array"); + DEBUG(dbgs() << "Verify " << RegBank << '\n'); RegBank.verify(TRI); } } void RegisterBankInfo::createRegisterBank(unsigned ID, const char *Name) { + DEBUG(dbgs() << "Create register bank: " << ID << " with name \"" << Name + << "\"\n"); RegisterBank &RegBank = getRegBank(ID); assert(RegBank.getID() == RegisterBank::InvalidID && "A register bank should be created only once"); @@ -50,6 +54,9 @@ void RegisterBankInfo::addRegBankCoverage(unsigned ID, const TargetRegisterInfo &TRI) { RegisterBank &RB = getRegBank(ID); unsigned NbOfRegClasses = TRI.getNumRegClasses(); + + DEBUG(dbgs() << "Add coverage for: " << RB << '\n'); + // Check if RB is underconstruction. if (!RB.isValid()) RB.ContainedRegClasses.resize(NbOfRegClasses); @@ -69,6 +76,10 @@ void RegisterBankInfo::addRegBankCoverage(unsigned ID, unsigned RCId = WorkList.pop_back_val(); const TargetRegisterClass &CurRC = *TRI.getRegClass(RCId); + + DEBUG(dbgs() << "Examine: " << TRI.getRegClassName(&CurRC) + << "(Size*8: " << (CurRC.getSize() * 8) << ")\n"); + // Remember the biggest size in bits. MaxSize = std::max(MaxSize, CurRC.getSize() * 8);