17 #ifndef LLVM_MCA_REGISTER_FILE_H 18 #define LLVM_MCA_REGISTER_FILE_H 46 struct RegisterMappingTracker {
51 const unsigned NumPhysRegs;
53 unsigned NumUsedPhysRegs;
58 const unsigned MaxMoveEliminatedPerCycle;
66 unsigned NumMoveEliminated;
69 bool AllowZeroMoveEliminationOnly;
71 RegisterMappingTracker(
unsigned NumPhysRegisters,
72 unsigned MaxMoveEliminated = 0U,
73 bool AllowZeroMoveElimOnly =
false)
74 : NumPhysRegs(NumPhysRegisters), NumUsedPhysRegs(0),
75 MaxMoveEliminatedPerCycle(MaxMoveEliminated), NumMoveEliminated(0U),
76 AllowZeroMoveEliminationOnly(AllowZeroMoveElimOnly) {}
97 using IndexPlusCostPairTy = std::pair<unsigned, unsigned>;
118 struct RegisterRenamingInfo {
119 IndexPlusCostPairTy IndexPlusCost;
122 bool AllowMoveElimination;
123 RegisterRenamingInfo()
124 : IndexPlusCost(std::make_pair(0U, 1U)), RenameAs(0U), AliasRegID(0U),
125 AllowMoveElimination(
false) {}
140 using RegisterMapping = std::pair<WriteRef, RegisterRenamingInfo>;
143 std::vector<RegisterMapping> RegisterMappings;
168 void allocatePhysRegs(
const RegisterRenamingInfo &Entry,
173 void freePhysRegs(
const RegisterRenamingInfo &Entry,
185 void initialize(
const MCSchedModel &SM,
unsigned NumRegs);
189 unsigned NumRegs = 0);
239 #endif // LLVM_MCA_REGISTER_FILE_H This class represents lattice values for constants.
void addRegisterWrite(WriteRef Write, MutableArrayRef< unsigned > UsedPhysRegs)
unsigned getNumRegisterFiles() const
Tracks register operand latency in cycles.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
A register file descriptor.
This file implements a class to represent arbitrary precision integral constant values and operations...
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
unsigned isAvailable(ArrayRef< unsigned > Regs) const
Manages hardware register files, and tracks register definitions for register renaming purposes...
RegisterFile(const MCSchedModel &SM, const MCRegisterInfo &mri, unsigned NumRegs=0)
This file defines a base class for describing a simulated hardware unit.
void removeRegisterWrite(const WriteState &WS, MutableArrayRef< unsigned > FreedPhysRegs)
Tracks uses of a register definition (e.g.
A reference to a register write.
Class for arbitrary precision integers.
bool tryEliminateMove(WriteState &WS, ReadState &RS)
void addRegisterRead(ReadState &RS, SmallVectorImpl< WriteRef > &Writes) const
Machine model for scheduling, bundling, and heuristics.