1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00

[AMDGPU] Use GCNRPTracker dumper methods in scheduler

Differential Revision: https://reviews.llvm.org/D33244

llvm-svn: 303186
This commit is contained in:
Stanislav Mekhanoshin 2017-05-16 16:31:45 +00:00
parent 483e8a2253
commit a3046641f4
3 changed files with 21 additions and 18 deletions

View File

@ -451,4 +451,16 @@ bool GCNUpwardRPTracker::isValid() const {
return true;
}
void GCNRPTracker::printLiveRegs(raw_ostream &OS, const LiveRegSet& LiveRegs,
const MachineRegisterInfo &MRI) {
const TargetRegisterInfo *TRI = MRI.getTargetRegisterInfo();
for (unsigned I = 0, E = MRI.getNumVirtRegs(); I != E; ++I) {
unsigned Reg = TargetRegisterInfo::index2VirtReg(I);
auto It = LiveRegs.find(Reg);
if (It != LiveRegs.end() && It->second.any())
OS << ' ' << PrintVRegOrUnit(Reg, TRI) << ':'
<< PrintLaneMask(It->second);
}
OS << '\n';
}
#endif

View File

@ -116,6 +116,8 @@ public:
decltype(LiveRegs) moveLiveRegs() {
return std::move(LiveRegs);
}
static void printLiveRegs(raw_ostream &OS, const LiveRegSet& LiveRegs,
const MachineRegisterInfo &MRI);
};
class GCNUpwardRPTracker : public GCNRPTracker {

View File

@ -337,21 +337,12 @@ void GCNScheduleDAGMILive::schedule() {
if (LIS) {
PressureBefore = Pressure[RegionIdx];
DEBUG(const SIRegisterInfo *SRI = static_cast<const SIRegisterInfo*>(TRI);
dbgs() << "Pressure before scheduling:\nRegion live-ins:";
for (unsigned I = 0, E = MRI.getNumVirtRegs(); I != E; ++I) {
unsigned Reg = TargetRegisterInfo::index2VirtReg(I);
auto It = LiveIns[RegionIdx].find(Reg);
if (It != LiveIns[RegionIdx].end() && It->second.any())
dbgs() << ' ' << PrintVRegOrUnit(Reg, SRI) << ':'
<< PrintLaneMask(It->second);
}
auto P = llvm::getRegPressure(MRI, LiveIns[RegionIdx]);
dbgs() << "\nLive-in pressure:\nSGPR = " << P.getSGPRNum()
<< "\nVGPR = " << P.getVGPRNum()
<< "\nReal region's register pressure:\nSGPR = "
<< PressureBefore.getSGPRNum()
<< "\nVGPR = " << PressureBefore.getVGPRNum() << '\n');
DEBUG(dbgs() << "Pressure before scheduling:\nRegion live-ins:";
GCNRPTracker::printLiveRegs(dbgs(), LiveIns[RegionIdx], MRI);
dbgs() << "Region live-in pressure: ";
llvm::getRegPressure(MRI, LiveIns[RegionIdx]).print(dbgs());
dbgs() << "Region register pressure: ";
PressureBefore.print(dbgs()));
}
ScheduleDAGMILive::schedule();
@ -364,9 +355,7 @@ void GCNScheduleDAGMILive::schedule() {
GCNMaxOccupancySchedStrategy &S = (GCNMaxOccupancySchedStrategy&)*SchedImpl;
auto PressureAfter = getRealRegPressure();
DEBUG(dbgs() << "Pressure after scheduling:\nSGPR = "
<< PressureAfter.getSGPRNum()
<< "\nVGPR = " << PressureAfter.getVGPRNum() << '\n');
DEBUG(dbgs() << "Pressure after scheduling: "; PressureAfter.print(dbgs()));
if (PressureAfter.getSGPRNum() <= S.SGPRCriticalLimit &&
PressureAfter.getVGPRNum() <= S.VGPRCriticalLimit) {