Skip to content

Commit 6129e4c

Browse files
[MCA] Add ReadState::dump (#153345)
WriteState has a dump function that provides some helpful info for debugging. Having this available in ReadState can be helpful as well in some instances.
1 parent dd5ba69 commit 6129e4c

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

llvm/include/llvm/MCA/Instruction.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,10 @@ class ReadState {
382382
bool isReadZero() const { return IsZero; }
383383
void setReadZero() { IsZero = true; }
384384
void setPRF(unsigned ID) { PRFID = ID; }
385+
386+
#ifndef NDEBUG
387+
void dump() const;
388+
#endif
385389
};
386390

387391
/// A sequence of cycles.

llvm/lib/MCA/Instruction.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,13 @@ void WriteState::dump() const {
128128
}
129129
#endif
130130

131+
#ifndef NDEBUG
132+
void ReadState::dump() const {
133+
dbgs() << "{ OpIdx=" << RD->OpIndex << ", RegID " << getRegisterID()
134+
<< ", Cycles Left=" << CyclesLeft << " }";
135+
}
136+
#endif
137+
131138
const CriticalDependency &Instruction::computeCriticalRegDep() {
132139
if (CriticalRegDep.Cycles)
133140
return CriticalRegDep;

0 commit comments

Comments
 (0)