diff options
| author | Andrew Trick <atrick@apple.com> | 2012-12-05 06:47:08 +0000 |
|---|---|---|
| committer | Andrew Trick <atrick@apple.com> | 2012-12-05 06:47:08 +0000 |
| commit | d52ab339cbcef7fba1866cdacf020d21f68d334d (patch) | |
| tree | b38d4a941366d17b894fd97641bc982fc51f111e /llvm/lib/CodeGen | |
| parent | 73b8a8a5e4c5e6572dd1fdb2d18d9741e13e5bb1 (diff) | |
| download | bcm5719-llvm-d52ab339cbcef7fba1866cdacf020d21f68d334d.tar.gz bcm5719-llvm-d52ab339cbcef7fba1866cdacf020d21f68d334d.zip | |
Added RegisterPressureTracker::dump() for debugging.
llvm-svn: 169359
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/RegisterPressure.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/RegisterPressure.cpp b/llvm/lib/CodeGen/RegisterPressure.cpp index 656d35acee1..777bc750295 100644 --- a/llvm/lib/CodeGen/RegisterPressure.cpp +++ b/llvm/lib/CodeGen/RegisterPressure.cpp @@ -64,7 +64,17 @@ void RegisterPressure::decrease(const TargetRegisterClass *RC, } #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +static void dumpSetPressure(const std::vector<unsigned> &SetPressure, + const TargetRegisterInfo *TRI) { + for (unsigned i = 0, e = SetPressure.size(); i < e; ++i) { + if (SetPressure[i] != 0) + dbgs() << TRI->getRegPressureSetName(i) << "=" << SetPressure[i] << '\n'; + } +} + void RegisterPressure::dump(const TargetRegisterInfo *TRI) const { + dbgs() << "Max Pressure: "; + dumpSetPressure(MaxSetPressure, TRI); dbgs() << "Live In: "; for (unsigned i = 0, e = LiveInRegs.size(); i < e; ++i) dbgs() << PrintReg(LiveInRegs[i], TRI) << " "; @@ -73,11 +83,12 @@ void RegisterPressure::dump(const TargetRegisterInfo *TRI) const { for (unsigned i = 0, e = LiveOutRegs.size(); i < e; ++i) dbgs() << PrintReg(LiveOutRegs[i], TRI) << " "; dbgs() << '\n'; - for (unsigned i = 0, e = MaxSetPressure.size(); i < e; ++i) { - if (MaxSetPressure[i] != 0) - dbgs() << TRI->getRegPressureSetName(i) << "=" << MaxSetPressure[i] - << '\n'; - } +} + +void RegPressureTracker::dump(const TargetRegisterInfo *TRI) const { + dbgs() << "Curr Pressure: "; + dumpSetPressure(CurrSetPressure, TRI); + P.dump(TRI); } #endif |

