[llvm] r265804 - [RegBankSelect] Improve debug output.
Quentin Colombet via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 8 09:48:16 PDT 2016
Author: qcolombet
Date: Fri Apr 8 11:48:16 2016
New Revision: 265804
URL: http://llvm.org/viewvc/llvm-project?rev=265804&view=rev
Log:
[RegBankSelect] Improve debug output.
Add verbose information when checking if the current and the desired
register banks match.
Detail what happens when we assign a register bank.
Modified:
llvm/trunk/lib/CodeGen/GlobalISel/RegBankSelect.cpp
Modified: llvm/trunk/lib/CodeGen/GlobalISel/RegBankSelect.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/RegBankSelect.cpp?rev=265804&r1=265803&r2=265804&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/RegBankSelect.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/RegBankSelect.cpp Fri Apr 8 11:48:16 2016
@@ -45,7 +45,14 @@ bool RegBankSelect::assignmentMatch(
if (ValMapping.BreakDown.size() > 1)
return false;
- return RBI->getRegBank(Reg, *MRI, *TRI) == ValMapping.BreakDown[0].RegBank;
+ const RegisterBank *CurRegBank = RBI->getRegBank(Reg, *MRI, *TRI);
+ const RegisterBank *DesiredRegBrank = ValMapping.BreakDown[0].RegBank;
+ DEBUG(dbgs() << "Does assignment already match: ";
+ if (CurRegBank) dbgs() << *CurRegBank; else dbgs() << "none";
+ dbgs() << " against ";
+ assert(DesiredRegBrank && "The mapping must be valid");
+ dbgs() << *DesiredRegBrank << '\n';);
+ return CurRegBank == DesiredRegBrank;
}
unsigned
@@ -116,6 +123,8 @@ void RegBankSelect::assignInstr(MachineI
// If that is not the case, this means the code was broken before
// hands because we should have found that the assignment match.
// This will not hold when we will consider alternative mappings.
+ DEBUG(dbgs() << "Assign: " << *ValMapping.BreakDown[0].RegBank << " to "
+ << PrintReg(Reg) << '\n');
MRI->setRegBank(Reg, *ValMapping.BreakDown[0].RegBank);
MO.setReg(Reg);
}
More information about the llvm-commits
mailing list