[llvm] a4202e6 - Move VTList pointer out of RegClassInfos
Benjamin Kramer via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 21 08:41:53 PDT 2023
Author: Benjamin Kramer
Date: 2023-08-21T17:40:40+02:00
New Revision: a4202e65cf54bd47f5c5bbc8c72de5305ffc39b9
URL: https://github.com/llvm/llvm-project/commit/a4202e65cf54bd47f5c5bbc8c72de5305ffc39b9
DIFF: https://github.com/llvm/llvm-project/commit/a4202e65cf54bd47f5c5bbc8c72de5305ffc39b9.diff
LOG: Move VTList pointer out of RegClassInfos
Store it in TargetRegisterInfo instead. Worth 54k on llc size.
Added:
Modified:
llvm/include/llvm/CodeGen/TargetRegisterInfo.h
llvm/lib/CodeGen/TargetRegisterInfo.cpp
llvm/unittests/CodeGen/MFCommon.inc
llvm/utils/TableGen/RegisterInfoEmitter.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/CodeGen/TargetRegisterInfo.h b/llvm/include/llvm/CodeGen/TargetRegisterInfo.h
index bf94bb85fc03c9..5bf27e40eee890 100644
--- a/llvm/include/llvm/CodeGen/TargetRegisterInfo.h
+++ b/llvm/include/llvm/CodeGen/TargetRegisterInfo.h
@@ -239,7 +239,7 @@ class TargetRegisterInfo : public MCRegisterInfo {
using vt_iterator = const MVT::SimpleValueType *;
struct RegClassInfo {
unsigned RegSize, SpillSize, SpillAlignment;
- vt_iterator VTList;
+ unsigned VTListOffset;
};
private:
const TargetRegisterInfoDesc *InfoDesc; // Extra desc array for codegen
@@ -250,6 +250,7 @@ class TargetRegisterInfo : public MCRegisterInfo {
regclass_iterator RegClassBegin, RegClassEnd; // List of regclasses
LaneBitmask CoveringLanes;
const RegClassInfo *const RCInfos;
+ const MVT::SimpleValueType *const RCVTLists;
unsigned HwMode;
protected:
@@ -260,6 +261,7 @@ class TargetRegisterInfo : public MCRegisterInfo {
const LaneBitmask *SRILaneMasks,
LaneBitmask CoveringLanes,
const RegClassInfo *const RCIs,
+ const MVT::SimpleValueType *const RCVTLists,
unsigned Mode = 0);
virtual ~TargetRegisterInfo();
@@ -316,7 +318,7 @@ class TargetRegisterInfo : public MCRegisterInfo {
/// Loop over all of the value types that can be represented by values
/// in the given register class.
vt_iterator legalclasstypes_begin(const TargetRegisterClass &RC) const {
- return getRegClassInfo(RC).VTList;
+ return &RCVTLists[getRegClassInfo(RC).VTListOffset];
}
vt_iterator legalclasstypes_end(const TargetRegisterClass &RC) const {
diff --git a/llvm/lib/CodeGen/TargetRegisterInfo.cpp b/llvm/lib/CodeGen/TargetRegisterInfo.cpp
index 77d2dfcf2323b9..1bb35f40facfd0 100644
--- a/llvm/lib/CodeGen/TargetRegisterInfo.cpp
+++ b/llvm/lib/CodeGen/TargetRegisterInfo.cpp
@@ -56,12 +56,13 @@ TargetRegisterInfo::TargetRegisterInfo(const TargetRegisterInfoDesc *ID,
const LaneBitmask *SRILaneMasks,
LaneBitmask SRICoveringLanes,
const RegClassInfo *const RCIs,
+ const MVT::SimpleValueType *const RCVTLists,
unsigned Mode)
: InfoDesc(ID), SubRegIndexNames(SRINames),
SubRegIndexLaneMasks(SRILaneMasks),
RegClassBegin(RCB), RegClassEnd(RCE),
CoveringLanes(SRICoveringLanes),
- RCInfos(RCIs), HwMode(Mode) {
+ RCInfos(RCIs), RCVTLists(RCVTLists), HwMode(Mode) {
}
TargetRegisterInfo::~TargetRegisterInfo() = default;
diff --git a/llvm/unittests/CodeGen/MFCommon.inc b/llvm/unittests/CodeGen/MFCommon.inc
index 7239663c6b16d1..4fa18accb0d07c 100644
--- a/llvm/unittests/CodeGen/MFCommon.inc
+++ b/llvm/unittests/CodeGen/MFCommon.inc
@@ -23,7 +23,7 @@ class BogusRegisterInfo : public TargetRegisterInfo {
public:
BogusRegisterInfo()
: TargetRegisterInfo(nullptr, BogusRegisterClasses, BogusRegisterClasses,
- nullptr, nullptr, LaneBitmask(~0u), nullptr) {
+ nullptr, nullptr, LaneBitmask(~0u), nullptr, nullptr) {
InitMCRegisterInfo(nullptr, 0, 0, 0, nullptr, 0, nullptr, 0, nullptr,
nullptr, nullptr, nullptr, nullptr, 0, nullptr, nullptr);
}
diff --git a/llvm/utils/TableGen/RegisterInfoEmitter.cpp b/llvm/utils/TableGen/RegisterInfoEmitter.cpp
index 7c0d024959c5a1..92ef9199cc4702 100644
--- a/llvm/utils/TableGen/RegisterInfoEmitter.cpp
+++ b/llvm/utils/TableGen/RegisterInfoEmitter.cpp
@@ -1290,7 +1290,7 @@ RegisterInfoEmitter::runTargetDesc(raw_ostream &OS, CodeGenTarget &Target,
for (const ValueTypeByHwMode &VVT : RC.VTs)
if (VVT.hasDefault() || VVT.hasMode(M))
VTs.push_back(VVT.get(M).SimpleTy);
- OS << ", VTLists+" << VTSeqs.get(VTs) << " }, // "
+ OS << ", /*VTLists+*/" << VTSeqs.get(VTs) << " }, // "
<< RC.getName() << '\n';
}
}
@@ -1652,7 +1652,7 @@ RegisterInfoEmitter::runTargetDesc(raw_ostream &OS, CodeGenTarget &Target,
<< " SubRegIndexNameTable, SubRegIndexLaneMaskTable,\n"
<< " ";
printMask(OS, RegBank.CoveringLanes);
- OS << ", RegClassInfos, HwMode) {\n"
+ OS << ", RegClassInfos, VTLists, HwMode) {\n"
<< " InitMCRegisterInfo(" << TargetName << "RegDesc, " << Regs.size() + 1
<< ", RA, PC,\n " << TargetName
<< "MCRegisterClasses, " << RegisterClasses.size() << ",\n"
More information about the llvm-commits
mailing list