diff --git a/llvm/include/llvm/MCA/Instruction.h b/llvm/include/llvm/MCA/Instruction.h index 4c683aa3421de..3cdbf84748c79 100644 --- a/llvm/include/llvm/MCA/Instruction.h +++ b/llvm/include/llvm/MCA/Instruction.h @@ -382,6 +382,10 @@ class ReadState { bool isReadZero() const { return IsZero; } void setReadZero() { IsZero = true; } void setPRF(unsigned ID) { PRFID = ID; } + +#ifndef NDEBUG + void dump() const; +#endif }; /// A sequence of cycles. diff --git a/llvm/lib/MCA/Instruction.cpp b/llvm/lib/MCA/Instruction.cpp index d4adfce597139..79667080ecbbc 100644 --- a/llvm/lib/MCA/Instruction.cpp +++ b/llvm/lib/MCA/Instruction.cpp @@ -128,6 +128,13 @@ void WriteState::dump() const { } #endif +#ifndef NDEBUG +void ReadState::dump() const { + dbgs() << "{ OpIdx=" << RD->OpIndex << ", RegID " << getRegisterID() + << ", Cycles Left=" << CyclesLeft << " }"; +} +#endif + const CriticalDependency &Instruction::computeCriticalRegDep() { if (CriticalRegDep.Cycles) return CriticalRegDep;