summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorQuentin Colombet <qcolombet@apple.com>2016-04-07 23:25:43 +0000
committerQuentin Colombet <qcolombet@apple.com>2016-04-07 23:25:43 +0000
commite087c9fc12d1aeff35aea347b4a3fe1025576a03 (patch)
tree6c8341f4921f1d97fe2ee741bbe82cd1d944653e /llvm/lib
parent03c419628e551983a11c739a001fe0cfbcfa90b1 (diff)
downloadbcm5719-llvm-e087c9fc12d1aeff35aea347b4a3fe1025576a03.tar.gz
bcm5719-llvm-e087c9fc12d1aeff35aea347b4a3fe1025576a03.zip
[RegisterBankInfo] Add print and dump method to the ValueMapping helper
class. llvm-svn: 265746
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp b/llvm/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp
index e63f561b7e7..262459f00c0 100644
--- a/llvm/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp
@@ -390,6 +390,22 @@ void RegisterBankInfo::ValueMapping::verify(unsigned ExpectedBitWidth) const {
assert(ValueMask.isAllOnesValue() && "Value is not fully mapped");
}
+void RegisterBankInfo::ValueMapping::dump() const {
+ print(dbgs());
+ dbgs() << '\n';
+}
+
+void RegisterBankInfo::ValueMapping::print(raw_ostream &OS) const {
+ OS << "#BreakDown: " << BreakDown.size() << " ";
+ bool IsFirst = true;
+ for (const PartialMapping &PartMap : BreakDown) {
+ if (!IsFirst)
+ OS << ", ";
+ OS << '[' << PartMap << ']';
+ IsFirst = false;
+ }
+}
+
void RegisterBankInfo::InstructionMapping::setOperandMapping(
unsigned OpIdx, unsigned MaskSize, const RegisterBank &RegBank) {
// Build the value mapping.
OpenPOWER on IntegriCloud