Skip to content

Commit e23140f

Browse files
committed
[MCA] Add identifier field to mca::Instruction
1 parent db782b4 commit e23140f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llvm/include/llvm/MCA/Instruction.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,9 @@ class Instruction : public InstructionBase {
643643
// True if this instruction has been optimized at register renaming stage.
644644
bool IsEliminated;
645645

646+
// Client-dependent identifier for this instruction.
647+
std::optional<uint64_t> Identifier;
648+
646649
public:
647650
Instruction(const InstrDesc &D, const unsigned Opcode)
648651
: InstructionBase(D, Opcode), Stage(IS_INVALID),
@@ -690,6 +693,9 @@ class Instruction : public InstructionBase {
690693
bool isRetired() const { return Stage == IS_RETIRED; }
691694
bool isEliminated() const { return IsEliminated; }
692695

696+
std::optional<uint64_t> getIdentifier() const { return Identifier; }
697+
void setIdentifier(uint64_t Id) { Identifier = Id; }
698+
693699
// Forces a transition from state IS_DISPATCHED to state IS_EXECUTED.
694700
void forceExecuted();
695701
void setEliminated() { IsEliminated = true; }

0 commit comments

Comments
 (0)