[llvm] 16dc821 - [RISCV] Remove isGPRF64AsFPR and isGPRPF64AsFPR functions from AsmParser. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 4 22:15:16 PST 2024
Author: Craig Topper
Date: 2024-01-04T22:13:40-08:00
New Revision: 16dc82122bee915d122a68a4f1680ab810012906
URL: https://github.com/llvm/llvm-project/commit/16dc82122bee915d122a68a4f1680ab810012906
DIFF: https://github.com/llvm/llvm-project/commit/16dc82122bee915d122a68a4f1680ab810012906.diff
LOG: [RISCV] Remove isGPRF64AsFPR and isGPRPF64AsFPR functions from AsmParser. NFC
These are identical to isGPRAsFPR. By overriding the PredicateMethod
on the AsmOperands in tblgen we can share a single function.
Added:
Modified:
llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
llvm/lib/Target/RISCV/RISCVInstrInfoD.td
Removed:
################################################################################
diff --git a/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp b/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
index 4759aa951664c7..23c2b63c8c832f 100644
--- a/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
+++ b/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
@@ -466,10 +466,6 @@ struct RISCVOperand final : public MCParsedAsmOperand {
bool isGPRAsFPR() const { return isGPR() && Reg.IsGPRAsFPR; }
- bool isGPRF64AsFPR() const { return isGPR() && Reg.IsGPRAsFPR; }
-
- bool isGPRPF64AsFPR() const { return isGPR() && Reg.IsGPRAsFPR; }
-
static bool evaluateConstantImm(const MCExpr *Expr, int64_t &Imm,
RISCVMCExpr::VariantKind &VK) {
if (auto *RE = dyn_cast<RISCVMCExpr>(Expr)) {
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoD.td b/llvm/lib/Target/RISCV/RISCVInstrInfoD.td
index 6af710049a9dd6..418421b2a556f7 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoD.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoD.td
@@ -36,11 +36,13 @@ def AddrRegImmINX : ComplexPattern<iPTR, 2, "SelectAddrRegImmINX">;
def GPRPF64AsFPR : AsmOperandClass {
let Name = "GPRPF64AsFPR";
let ParserMethod = "parseGPRAsFPR";
+ let PredicateMethod = "isGPRAsFPR";
let RenderMethod = "addRegOperands";
}
def GPRF64AsFPR : AsmOperandClass {
let Name = "GPRF64AsFPR";
+ let PredicateMethod = "isGPRAsFPR";
let ParserMethod = "parseGPRAsFPR";
let RenderMethod = "addRegOperands";
}
More information about the llvm-commits
mailing list