Skip to content

Commit

Permalink
[MCA] Add identifier field to mca::Instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinmay Deshpande committed Jul 6, 2024
1 parent db782b4 commit e23140f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions llvm/include/llvm/MCA/Instruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint64_t> Identifier;

public:
Instruction(const InstrDesc &D, const unsigned Opcode)
: InstructionBase(D, Opcode), Stage(IS_INVALID),
Expand Down Expand Up @@ -690,6 +693,9 @@ class Instruction : public InstructionBase {
bool isRetired() const { return Stage == IS_RETIRED; }
bool isEliminated() const { return IsEliminated; }

std::optional<uint64_t> 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; }
Expand Down

0 comments on commit e23140f

Please sign in to comment.