[llvm-mca] Fix RegisterFile debug prints. NFC

llvm-svn: 336367
This commit is contained in:
Andrea Di Biagio 2018-07-05 16:13:49 +00:00
parent 53ec0a075d
commit fa2d16f4ab
2 changed files with 9 additions and 3 deletions

View File

@ -94,10 +94,11 @@ void ReadState::cycleEvent() {
#ifndef NDEBUG
void WriteState::dump() const {
dbgs() << "{ OpIdx=" << WD.OpIndex << ", Lat=" << WD.Latency << ", RegID "
<< getRegisterID() << ", Cycles Left=" << getCyclesLeft() << " }\n";
<< getRegisterID() << ", Cycles Left=" << getCyclesLeft() << " }";
}
void WriteRef::dump() const {
dbgs() << "IID=" << getSourceIndex() << ' ';
if (isValid())
getWriteState()->dump();
else

View File

@ -215,7 +215,7 @@ void RegisterFile::collectWrites(SmallVectorImpl<WriteRef> &Writes,
const WriteState &WS = *WR.getWriteState();
dbgs() << "Found a dependent use of Register "
<< MRI.getName(WS.getRegisterID()) << " (defined by intruction #"
<< WR.getSourceIndex() << '\n';
<< WR.getSourceIndex() << ")\n";
}
});
}
@ -264,9 +264,14 @@ unsigned RegisterFile::isAvailable(ArrayRef<unsigned> Regs) const {
void RegisterFile::dump() const {
for (unsigned I = 0, E = MRI.getNumRegs(); I < E; ++I) {
const RegisterMapping &RM = RegisterMappings[I];
dbgs() << MRI.getName(I) << ", " << I << ", Map=" << RM.second.first
if (!RM.first.getWriteState())
continue;
const std::pair<unsigned, unsigned> &IndexPlusCost = RM.second;
dbgs() << MRI.getName(I) << ", " << I << ", PRF=" << IndexPlusCost.first
<< ", Cost=" << IndexPlusCost.second
<< ", ";
RM.first.dump();
dbgs() << '\n';
}
for (unsigned I = 0, E = getNumRegisterFiles(); I < E; ++I) {