[AMDGPU] Use MCRegister instead of unsigned. NFC#167558
Merged
Conversation
Member
|
@llvm/pr-subscribers-backend-amdgpu Author: Craig Topper (topperc) ChangesFull diff: https://github.com/llvm/llvm-project/pull/167558.diff 1 Files Affected:
diff --git a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
index 09338c533fdf2..5e0486aa1dd49 100644
--- a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
+++ b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
@@ -1865,7 +1865,7 @@ class AMDGPUAsmParser : public MCTargetAsmParser {
unsigned getConstantBusLimit(unsigned Opcode) const;
bool usesConstantBus(const MCInst &Inst, unsigned OpIdx);
bool isInlineConstant(const MCInst &Inst, unsigned OpIdx) const;
- unsigned findImplicitSGPRReadInVOP(const MCInst &Inst) const;
+ MCRegister findImplicitSGPRReadInVOP(const MCInst &Inst) const;
bool isSupportedMnemo(StringRef Mnemo,
const FeatureBitset &FBS);
@@ -3665,7 +3665,8 @@ StringRef AMDGPUAsmParser::getMatchedVariantName() const {
return "";
}
-unsigned AMDGPUAsmParser::findImplicitSGPRReadInVOP(const MCInst &Inst) const {
+MCRegister
+AMDGPUAsmParser::findImplicitSGPRReadInVOP(const MCInst &Inst) const {
const MCInstrDesc &Desc = MII.get(Inst.getOpcode());
for (MCPhysReg Reg : Desc.implicit_uses()) {
switch (Reg) {
@@ -3679,7 +3680,7 @@ unsigned AMDGPUAsmParser::findImplicitSGPRReadInVOP(const MCInst &Inst) const {
break;
}
}
- return AMDGPU::NoRegister;
+ return MCRegister();
}
// NB: This code is correct only when used to check constant
@@ -3854,9 +3855,9 @@ bool AMDGPUAsmParser::validateConstantBusLimitations(
LiteralSize = 4;
}
- SmallDenseSet<unsigned> SGPRsUsed;
- unsigned SGPRUsed = findImplicitSGPRReadInVOP(Inst);
- if (SGPRUsed != AMDGPU::NoRegister) {
+ SmallDenseSet<MCRegister> SGPRsUsed;
+ MCRegister SGPRUsed = findImplicitSGPRReadInVOP(Inst);
+ if (SGPRUsed) {
SGPRsUsed.insert(SGPRUsed);
++ConstantBusUseCount;
}
|
arsenm
approved these changes
Nov 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.