[llvm] 616d30c - [AMDGPU][AsmParser][NFC] Simplify the EndpgmImm operand definition.
Ivan Kosarev via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 13 10:46:21 PDT 2023
Author: Ivan Kosarev
Date: 2023-06-13T18:46:08+01:00
New Revision: 616d30c2cc3b4e859a4ca53b667f8214362ce490
URL: https://github.com/llvm/llvm-project/commit/616d30c2cc3b4e859a4ca53b667f8214362ce490
DIFF: https://github.com/llvm/llvm-project/commit/616d30c2cc3b4e859a4ca53b667f8214362ce490.diff
LOG: [AMDGPU][AsmParser][NFC] Simplify the EndpgmImm operand definition.
Clears the road to eliminating custom default operand handlers. Also
unifies naming of related entities.
Part of <https://github.com/llvm/llvm-project/issues/62629>.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D151687
Added:
Modified:
llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
llvm/lib/Target/AMDGPU/SIInstrInfo.td
llvm/lib/Target/AMDGPU/SOPInstructions.td
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
index 7b4817f373b56..6205678f48cd3 100644
--- a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
+++ b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
@@ -1823,8 +1823,8 @@ class AMDGPUAsmParser : public MCTargetAsmParser {
AMDGPUOperand::Ptr defaultCBSZ() const;
AMDGPUOperand::Ptr defaultABID() const;
- OperandMatchResultTy parseEndpgmOp(OperandVector &Operands);
- AMDGPUOperand::Ptr defaultEndpgmImmOperands() const;
+ OperandMatchResultTy parseEndpgm(OperandVector &Operands);
+ AMDGPUOperand::Ptr defaultEndpgm() const;
AMDGPUOperand::Ptr defaultWaitVDST() const;
AMDGPUOperand::Ptr defaultWaitEXP() const;
@@ -8713,7 +8713,7 @@ AMDGPUOperand::Ptr AMDGPUAsmParser::defaultDppRowMask() const {
return AMDGPUOperand::CreateImm(this, 0xf, SMLoc(), AMDGPUOperand::ImmTyDppRowMask);
}
-AMDGPUOperand::Ptr AMDGPUAsmParser::defaultEndpgmImmOperands() const {
+AMDGPUOperand::Ptr AMDGPUAsmParser::defaultEndpgm() const {
return AMDGPUOperand::CreateImm(this, 0, SMLoc(), AMDGPUOperand::ImmTyEndpgm);
}
@@ -9196,7 +9196,7 @@ unsigned AMDGPUAsmParser::validateTargetOperandClass(MCParsedAsmOperand &Op,
// endpgm
//===----------------------------------------------------------------------===//
-OperandMatchResultTy AMDGPUAsmParser::parseEndpgmOp(OperandVector &Operands) {
+OperandMatchResultTy AMDGPUAsmParser::parseEndpgm(OperandVector &Operands) {
SMLoc S = getLoc();
int64_t Imm = 0;
diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.td b/llvm/lib/Target/AMDGPU/SIInstrInfo.td
index 4cbe0fca7e69e..c9272b87a8370 100644
--- a/llvm/lib/Target/AMDGPU/SIInstrInfo.td
+++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.td
@@ -980,14 +980,6 @@ def SwizzleMatchClass : AsmOperandClass {
let IsOptional = 1;
}
-def EndpgmMatchClass : AsmOperandClass {
- let Name = "EndpgmImm";
- let PredicateMethod = "isEndpgm";
- let ParserMethod = "parseEndpgmOp";
- let RenderMethod = "addImmOperands";
- let IsOptional = 1;
-}
-
def SWaitMatchClass : AsmOperandClass {
let Name = "SWaitCnt";
let RenderMethod = "addImmOperands";
@@ -1022,10 +1014,7 @@ def SwizzleImm : Operand<i16> {
let ParserMatchClass = SwizzleMatchClass;
}
-def EndpgmImm : Operand<i16> {
- let PrintMethod = "printEndpgm";
- let ParserMatchClass = EndpgmMatchClass;
-}
+def Endpgm : CustomOperand<i16, 1>;
def WAIT_FLAG : Operand <i32> {
let ParserMatchClass = SWaitMatchClass;
diff --git a/llvm/lib/Target/AMDGPU/SOPInstructions.td b/llvm/lib/Target/AMDGPU/SOPInstructions.td
index ad9af662307f2..04e2521cab21b 100644
--- a/llvm/lib/Target/AMDGPU/SOPInstructions.td
+++ b/llvm/lib/Target/AMDGPU/SOPInstructions.td
@@ -1175,7 +1175,7 @@ multiclass SOPP_With_Relaxation <string opName, dag ins,
def S_NOP : SOPP_Pseudo<"s_nop" , (ins i16imm:$simm16), "$simm16">;
let isTerminator = 1 in {
-def S_ENDPGM : SOPP_Pseudo<"s_endpgm", (ins EndpgmImm:$simm16), "$simm16", [], ""> {
+def S_ENDPGM : SOPP_Pseudo<"s_endpgm", (ins Endpgm:$simm16), "$simm16", [], ""> {
let isBarrier = 1;
let isReturn = 1;
let hasSideEffects = 1;
More information about the llvm-commits
mailing list