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 | 17cf53519905acb69c567173bedd2df1c8e45523 (patch) | |
tree | bc3e0f85ea5613f0b5682178398089b3cd5d1a33 /lib/CodeGen/RegisterPressure.cpp | |
parent | 83dbce2fc817fcb094a8958ca713fd3ba13758c5 (diff) | |
download | llvm-17cf53519905acb69c567173bedd2df1c8e45523.tar.gz llvm-17cf53519905acb69c567173bedd2df1c8e45523.tar.bz2 llvm-17cf53519905acb69c567173bedd2df1c8e45523.tar.xz |
Added RegisterPressureTracker::dump() for debugging.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169359 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegisterPressure.cpp')
-rw-r--r-- | lib/CodeGen/RegisterPressure.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/lib/CodeGen/RegisterPressure.cpp b/lib/CodeGen/RegisterPressure.cpp index 656d35acee..777bc75029 100644 --- a/lib/CodeGen/RegisterPressure.cpp +++ b/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 |