diff --git a/llvm/include/llvm/MCA/Instruction.h b/llvm/include/llvm/MCA/Instruction.h index e48a70164bec6c..4fb0a62ac7f8c4 100644 --- a/llvm/include/llvm/MCA/Instruction.h +++ b/llvm/include/llvm/MCA/Instruction.h @@ -643,6 +643,9 @@ class Instruction : public InstructionBase { // True if this instruction has been optimized at register renaming stage. bool IsEliminated; + // Client-dependent identifier for this instruction. + std::optional Identifier; + public: Instruction(const InstrDesc &D, const unsigned Opcode) : InstructionBase(D, Opcode), Stage(IS_INVALID), @@ -690,6 +693,9 @@ class Instruction : public InstructionBase { bool isRetired() const { return Stage == IS_RETIRED; } bool isEliminated() const { return IsEliminated; } + std::optional getIdentifier() const { return Identifier; } + void setIdentifier(uint64_t Id) { Identifier = Id; } + // Forces a transition from state IS_DISPATCHED to state IS_EXECUTED. void forceExecuted(); void setEliminated() { IsEliminated = true; }