[llvm] e0a5155 - [LoongArch] Simplify RISCVSubtarget. NFC
WANG Rui via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 26 02:08:32 PDT 2024
Author: WANG Rui
Date: 2024-04-26T17:07:00+08:00
New Revision: e0a51553c40ec9193be30a5ee41d786ef896811b
URL: https://github.com/llvm/llvm-project/commit/e0a51553c40ec9193be30a5ee41d786ef896811b
DIFF: https://github.com/llvm/llvm-project/commit/e0a51553c40ec9193be30a5ee41d786ef896811b.diff
LOG: [LoongArch] Simplify RISCVSubtarget. NFC
The flags, initialization of the flags, and the getter methods for
features defined in LoongArch.td can be generated by TableGen.
Added:
Modified:
llvm/lib/Target/LoongArch/LoongArchSubtarget.h
Removed:
################################################################################
diff --git a/llvm/lib/Target/LoongArch/LoongArchSubtarget.h b/llvm/lib/Target/LoongArch/LoongArchSubtarget.h
index cecb4a50aa7633..a6e40840517fa8 100644
--- a/llvm/lib/Target/LoongArch/LoongArchSubtarget.h
+++ b/llvm/lib/Target/LoongArch/LoongArchSubtarget.h
@@ -31,21 +31,11 @@ class StringRef;
class LoongArchSubtarget : public LoongArchGenSubtargetInfo {
virtual void anchor();
- bool HasLA32 = false;
- bool HasLA64 = false;
- bool HasBasicF = false;
- bool HasBasicD = false;
- bool HasExtLSX = false;
- bool HasExtLASX = false;
- bool HasExtLVZ = false;
- bool HasExtLBT = false;
- bool HasLaGlobalWithPcrel = false;
- bool HasLaGlobalWithAbs = false;
- bool HasLaLocalWithAbs = false;
- bool HasUAL = false;
- bool HasLinkerRelax = false;
- bool HasExpAutoVec = false;
- bool HasFrecipe = false;
+
+#define GET_SUBTARGETINFO_MACRO(ATTRIBUTE, DEFAULT, GETTER) \
+ bool ATTRIBUTE = DEFAULT;
+#include "LoongArchGenSubtargetInfo.inc"
+
unsigned GRLen = 32;
MVT GRLenVT = MVT::i32;
LoongArchABI::ABI TargetABI = LoongArchABI::ABI_Unknown;
@@ -92,20 +82,12 @@ class LoongArchSubtarget : public LoongArchGenSubtargetInfo {
const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
return &TSInfo;
}
+
+#define GET_SUBTARGETINFO_MACRO(ATTRIBUTE, DEFAULT, GETTER) \
+ bool GETTER() const { return ATTRIBUTE; }
+#include "LoongArchGenSubtargetInfo.inc"
+
bool is64Bit() const { return HasLA64; }
- bool hasBasicF() const { return HasBasicF; }
- bool hasBasicD() const { return HasBasicD; }
- bool hasExtLSX() const { return HasExtLSX; }
- bool hasExtLASX() const { return HasExtLASX; }
- bool hasExtLVZ() const { return HasExtLVZ; }
- bool hasExtLBT() const { return HasExtLBT; }
- bool hasLaGlobalWithPcrel() const { return HasLaGlobalWithPcrel; }
- bool hasLaGlobalWithAbs() const { return HasLaGlobalWithAbs; }
- bool hasLaLocalWithAbs() const { return HasLaLocalWithAbs; }
- bool hasUAL() const { return HasUAL; }
- bool hasLinkerRelax() const { return HasLinkerRelax; }
- bool hasExpAutoVec() const { return HasExpAutoVec; }
- bool hasFrecipe() const { return HasFrecipe; }
MVT getGRLenVT() const { return GRLenVT; }
unsigned getGRLen() const { return GRLen; }
LoongArchABI::ABI getTargetABI() const { return TargetABI; }
More information about the llvm-commits
mailing list