mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Added RegisterPressureTracker::dump() for debugging.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169359 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
83dbce2fc8
commit
17cf535199
@ -273,6 +273,8 @@ public:
|
||||
return getDownwardPressure(MI, PressureResult, MaxPressureResult);
|
||||
}
|
||||
|
||||
void dump(const TargetRegisterInfo *TRI) const;
|
||||
|
||||
protected:
|
||||
void increasePhysRegPressure(ArrayRef<unsigned> Regs);
|
||||
void decreasePhysRegPressure(ArrayRef<unsigned> Regs);
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user