summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuentin Colombet <qcolombet@apple.com>2016-04-07 23:53:55 +0000
committerQuentin Colombet <qcolombet@apple.com>2016-04-07 23:53:55 +0000
commite16f561d911c037375044d379de08e7f3c156102 (patch)
tree58a42cc9bf6550699aee13914041400562a628b0
parentd86ec30168d945a577a258736dcca0ea8e549588 (diff)
downloadbcm5719-llvm-e16f561d911c037375044d379de08e7f3c156102.tar.gz
bcm5719-llvm-e16f561d911c037375044d379de08e7f3c156102.zip
[RegBankSelect] Add a few debug statements.
llvm-svn: 265749
-rw-r--r--llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp b/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp
index 4e0650e04f9..f5c9370805f 100644
--- a/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp
@@ -13,6 +13,7 @@
#include "llvm/CodeGen/GlobalISel/RegBankSelect.h"
#include "llvm/CodeGen/GlobalISel/RegisterBank.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
+#include "llvm/Support/Debug.h"
#include "llvm/Target/TargetSubtargetInfo.h"
#define DEBUG_TYPE "regbankselect"
@@ -58,14 +59,20 @@ RegBankSelect::repairReg(unsigned Reg,
unsigned NewReg =
MRI->createGenericVirtualRegister(PartialMap.Mask.getBitWidth());
(void)MIRBuilder.buildInstr(TargetOpcode::COPY, NewReg, Reg);
+ DEBUG(dbgs() << "Repair: " << PrintReg(Reg) << " with: "
+ << PrintReg(NewReg) << '\n');
return NewReg;
}
void RegBankSelect::assignInstr(MachineInstr &MI) {
+ DEBUG(dbgs() << "Assign: " << MI);
const RegisterBankInfo::InstructionMapping DefaultMapping =
RBI->getInstrMapping(MI);
// Make sure the mapping is valid for MI.
DefaultMapping.verify(MI);
+
+ DEBUG(dbgs() << "Mapping: " << DefaultMapping << '\n');
+
// Set the insertion point before MI.
// This is where we are going to insert the repairing code if any.
MIRBuilder.setInstr(MI, /*Before*/ true);
@@ -112,9 +119,11 @@ void RegBankSelect::assignInstr(MachineInstr &MI) {
MRI->setRegBank(Reg, *ValMapping.BreakDown[0].RegBank);
MO.setReg(Reg);
}
+ DEBUG(dbgs() << "Assigned: " << MI);
}
bool RegBankSelect::runOnMachineFunction(MachineFunction &MF) {
+ DEBUG(dbgs() << "Assign register banks for: " << MF.getName() << '\n');
init(MF);
// Walk the function and assign register banks to all operands.
for (MachineBasicBlock &MBB : MF)
OpenPOWER on IntegriCloud