diff options
author | Quentin Colombet <qcolombet@apple.com> | 2016-04-07 23:31:58 +0000 |
---|---|---|
committer | Quentin Colombet <qcolombet@apple.com> | 2016-04-07 23:31:58 +0000 |
commit | 9a2ae85e6726c2bf9495cd72c4fbf95f305524f5 (patch) | |
tree | c349d357ff61a1cca1884d1670df46fd5697b347 /llvm/lib/CodeGen/GlobalISel | |
parent | e087c9fc12d1aeff35aea347b4a3fe1025576a03 (diff) | |
download | bcm5719-llvm-9a2ae85e6726c2bf9495cd72c4fbf95f305524f5.tar.gz bcm5719-llvm-9a2ae85e6726c2bf9495cd72c4fbf95f305524f5.zip |
[RegisterBankInfo] Add print and dump method to the InstructionMapping
helper class.
llvm-svn: 265747
Diffstat (limited to 'llvm/lib/CodeGen/GlobalISel')
-rw-r--r-- | llvm/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp b/llvm/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp index 262459f00c0..f3bf1690ac8 100644 --- a/llvm/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp +++ b/llvm/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp @@ -447,3 +447,19 @@ void RegisterBankInfo::InstructionMapping::verify( MOMapping.verify(RegSize); } } + +void RegisterBankInfo::InstructionMapping::dump() const { + print(dbgs()); + dbgs() << '\n'; +} + +void RegisterBankInfo::InstructionMapping::print(raw_ostream &OS) const { + OS << "ID: " << getID() << " Cost: " << getCost() << " Mapping: "; + + for (unsigned OpIdx = 0; OpIdx != NumOperands; ++OpIdx) { + const ValueMapping &ValMapping = getOperandMapping(OpIdx); + if (OpIdx) + OS << ", "; + OS << "{ Idx: " << OpIdx << " Map: " << ValMapping << '}'; + } +} |