Skip to content

Commit

Permalink
[llvm-mca] Add optional identifier field to mca::Instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinmay Deshpande committed Jul 5, 2024
1 parent db782b4 commit f44dd7f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions llvm/include/llvm/MCA/Instruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,8 @@ class Instruction : public InstructionBase {
// True if this instruction has been optimized at register renaming stage.
bool IsEliminated;

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 +692,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 f44dd7f

Please sign in to comment.