@@ -93,8 +93,6 @@ class RegisterInfoEmitter {
93
93
void EmitRegUnitPressure (raw_ostream &OS, StringRef ClassName);
94
94
void emitComposeSubRegIndices (raw_ostream &OS, StringRef ClassName);
95
95
void emitComposeSubRegIndexLaneMask (raw_ostream &OS, StringRef ClassName);
96
- void emitNumAllocatableSubRegs (raw_ostream &OS, StringRef ClassName,
97
- llvm::BitVector &InAllocClass);
98
96
};
99
97
100
98
} // end anonymous namespace
@@ -679,31 +677,6 @@ static bool combine(const CodeGenSubRegIndex *Idx,
679
677
return true ;
680
678
}
681
679
682
- void RegisterInfoEmitter::emitNumAllocatableSubRegs (
683
- raw_ostream &OS, StringRef ClassName, llvm::BitVector &InAllocClass) {
684
- OS << " unsigned " << ClassName
685
- << " ::getNumAllocatableSubRegsImpl(MCPhysReg R) const {\n " ;
686
- OS << " static unsigned numAllocatableSubRegsMap[] = { \n " ;
687
- OS << " 0, // NoRegister\n " ;
688
- const auto &Regs = RegBank.getRegisters ();
689
- for (auto [I, R] : llvm::enumerate (Regs)) {
690
- unsigned NumAllocatableSubRegs = 0 ;
691
- for (unsigned U : R.getRegUnits ()) {
692
- for (const CodeGenRegister *UR : RegBank.getRegUnit (U).getRoots ())
693
- if (!UR->Artificial && InAllocClass[UR->EnumValue ])
694
- NumAllocatableSubRegs++;
695
- }
696
- OS << " " << NumAllocatableSubRegs;
697
- if (I < Regs.size () - 1 )
698
- OS << " ," ;
699
- OS << " // " << R.getName () << " \n " ;
700
- }
701
- OS << " };\n " ;
702
- OS << " assert(R <= " << Regs.size () << " && \" Unexpected physreg\" );\n " ;
703
- OS << " return numAllocatableSubRegsMap[R];\n " ;
704
- OS << " };\n " ;
705
- }
706
-
707
680
void RegisterInfoEmitter::emitComposeSubRegIndices (raw_ostream &OS,
708
681
StringRef ClassName) {
709
682
const auto &SubRegIndices = RegBank.getSubRegIndices ();
@@ -1149,9 +1122,7 @@ void RegisterInfoEmitter::runTargetHeader(raw_ostream &OS) {
1149
1122
<< " const TargetRegisterClass *getSubClassWithSubReg"
1150
1123
<< " (const TargetRegisterClass *, unsigned) const override;\n "
1151
1124
<< " const TargetRegisterClass *getSubRegisterClass"
1152
- << " (const TargetRegisterClass *, unsigned) const override;\n "
1153
- << " unsigned getNumAllocatableSubRegsImpl(MCPhysReg) const "
1154
- " override;\n " ;
1125
+ << " (const TargetRegisterClass *, unsigned) const override;\n " ;
1155
1126
}
1156
1127
OS << " const RegClassWeight &getRegClassWeight("
1157
1128
<< " const TargetRegisterClass *RC) const override;\n "
@@ -1512,7 +1483,6 @@ void RegisterInfoEmitter::runTargetDesc(raw_ostream &OS) {
1512
1483
if (!SubRegIndices.empty ()) {
1513
1484
emitComposeSubRegIndices (OS, ClassName);
1514
1485
emitComposeSubRegIndexLaneMask (OS, ClassName);
1515
- emitNumAllocatableSubRegs (OS, ClassName, InAllocClass);
1516
1486
}
1517
1487
1518
1488
if (!SubRegIndices.empty ()) {
0 commit comments