Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions llvm/lib/Target/AMDGPU/AMDGPUInsertDelayAlu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class AMDGPUInsertDelayAlu {
};

// A map from regunits to the delay info for that regunit.
struct DelayState : DenseMap<unsigned, DelayInfo> {
struct DelayState : DenseMap<MCRegUnit, DelayInfo> {
// Merge another DelayState into this one by merging the delay info for each
// regunit.
void merge(const DelayState &RHS) {
Expand Down Expand Up @@ -359,7 +359,8 @@ class AMDGPUInsertDelayAlu {
bool Changed = false;
MachineInstr *LastDelayAlu = nullptr;

MCRegUnit LastSGPRFromVALU = 0;
// FIXME: 0 is a valid register unit.
MCRegUnit LastSGPRFromVALU = static_cast<MCRegUnit>(0);
// Iterate over the contents of bundles, but don't emit any instructions
// inside a bundle.
for (auto &MI : MBB.instrs()) {
Expand All @@ -379,7 +380,8 @@ class AMDGPUInsertDelayAlu {
if (It != State.end()) {
DelayInfo Info = It->getSecond();
State.advanceByVALUNum(Info.VALUNum);
LastSGPRFromVALU = 0;
// FIXME: 0 is a valid register unit.
LastSGPRFromVALU = static_cast<MCRegUnit>(0);
}
}

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ int GCNHazardRecognizer::getWaitStatesSinceSetReg(IsHazardFn IsHazard,
static void addRegUnits(const SIRegisterInfo &TRI, BitVector &BV,
MCRegister Reg) {
for (MCRegUnit Unit : TRI.regunits(Reg))
BV.set(Unit);
BV.set(static_cast<unsigned>(Unit));
}

static void addRegsToSet(const SIRegisterInfo &TRI,
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AMDGPU/SIPostRABundler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void SIPostRABundler::collectUsedRegUnits(const MachineInstr &MI,
"subregister indexes should not be present after RA");

for (MCRegUnit Unit : TRI->regunits(Reg))
UsedRegUnits.set(Unit);
UsedRegUnits.set(static_cast<unsigned>(Unit));
}
}

Expand Down
8 changes: 5 additions & 3 deletions llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,12 @@ SIRegisterInfo::SIRegisterInfo(const GCNSubtarget &ST)
"getNumCoveredRegs() will not work with generated subreg masks!");

RegPressureIgnoredUnits.resize(getNumRegUnits());
RegPressureIgnoredUnits.set(*regunits(MCRegister::from(AMDGPU::M0)).begin());
RegPressureIgnoredUnits.set(
static_cast<unsigned>(*regunits(MCRegister::from(AMDGPU::M0)).begin()));
for (auto Reg : AMDGPU::VGPR_16RegClass) {
if (AMDGPU::isHi16Reg(Reg, *this))
RegPressureIgnoredUnits.set(*regunits(Reg).begin());
RegPressureIgnoredUnits.set(
static_cast<unsigned>(*regunits(Reg).begin()));
}

// HACK: Until this is fully tablegen'd.
Expand Down Expand Up @@ -3784,7 +3786,7 @@ unsigned SIRegisterInfo::getRegPressureSetLimit(const MachineFunction &MF,
const int *SIRegisterInfo::getRegUnitPressureSets(MCRegUnit RegUnit) const {
static const int Empty[] = { -1 };

if (RegPressureIgnoredUnits[RegUnit])
if (RegPressureIgnoredUnits[static_cast<unsigned>(RegUnit)])
return Empty;

return AMDGPUGenRegisterInfo::getRegUnitPressureSets(RegUnit);
Expand Down
Loading