Skip to content

Commit ee41ab3

Browse files
authored
[AMDGPU] Use MCRegister instead of unsigned. NFC (#167558)
1 parent 85d2b10 commit ee41ab3

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,7 +1865,7 @@ class AMDGPUAsmParser : public MCTargetAsmParser {
18651865
unsigned getConstantBusLimit(unsigned Opcode) const;
18661866
bool usesConstantBus(const MCInst &Inst, unsigned OpIdx);
18671867
bool isInlineConstant(const MCInst &Inst, unsigned OpIdx) const;
1868-
unsigned findImplicitSGPRReadInVOP(const MCInst &Inst) const;
1868+
MCRegister findImplicitSGPRReadInVOP(const MCInst &Inst) const;
18691869

18701870
bool isSupportedMnemo(StringRef Mnemo,
18711871
const FeatureBitset &FBS);
@@ -3665,7 +3665,8 @@ StringRef AMDGPUAsmParser::getMatchedVariantName() const {
36653665
return "";
36663666
}
36673667

3668-
unsigned AMDGPUAsmParser::findImplicitSGPRReadInVOP(const MCInst &Inst) const {
3668+
MCRegister
3669+
AMDGPUAsmParser::findImplicitSGPRReadInVOP(const MCInst &Inst) const {
36693670
const MCInstrDesc &Desc = MII.get(Inst.getOpcode());
36703671
for (MCPhysReg Reg : Desc.implicit_uses()) {
36713672
switch (Reg) {
@@ -3679,7 +3680,7 @@ unsigned AMDGPUAsmParser::findImplicitSGPRReadInVOP(const MCInst &Inst) const {
36793680
break;
36803681
}
36813682
}
3682-
return AMDGPU::NoRegister;
3683+
return MCRegister();
36833684
}
36843685

36853686
// NB: This code is correct only when used to check constant
@@ -3854,9 +3855,9 @@ bool AMDGPUAsmParser::validateConstantBusLimitations(
38543855
LiteralSize = 4;
38553856
}
38563857

3857-
SmallDenseSet<unsigned> SGPRsUsed;
3858-
unsigned SGPRUsed = findImplicitSGPRReadInVOP(Inst);
3859-
if (SGPRUsed != AMDGPU::NoRegister) {
3858+
SmallDenseSet<MCRegister> SGPRsUsed;
3859+
MCRegister SGPRUsed = findImplicitSGPRReadInVOP(Inst);
3860+
if (SGPRUsed) {
38603861
SGPRsUsed.insert(SGPRUsed);
38613862
++ConstantBusUseCount;
38623863
}

0 commit comments

Comments
 (0)