Lines Matching refs:OS
83 void debugDump(raw_ostream &OS);
91 void EmitRegUnitPressure(raw_ostream &OS, const CodeGenRegBank &RegBank,
93 void emitComposeSubRegIndices(raw_ostream &OS, CodeGenRegBank &RegBank,
95 void emitComposeSubRegIndexLaneMask(raw_ostream &OS, CodeGenRegBank &RegBank,
102 void RegisterInfoEmitter::runEnums(raw_ostream &OS, in runEnums() argument
111 emitSourceFileHeader("Target Register Enum Values", OS); in runEnums()
113 OS << "\n#ifdef GET_REGINFO_ENUM\n"; in runEnums()
114 OS << "#undef GET_REGINFO_ENUM\n\n"; in runEnums()
116 OS << "namespace llvm {\n\n"; in runEnums()
118 OS << "class MCRegisterClass;\n" in runEnums()
123 OS << "namespace " << Namespace << " {\n"; in runEnums()
124 OS << "enum {\n NoRegister,\n"; in runEnums()
127 OS << " " << Reg.getName() << " = " << Reg.EnumValue << ",\n"; in runEnums()
130 OS << " NUM_TARGET_REGS // " << Registers.size()+1 << "\n"; in runEnums()
131 OS << "};\n"; in runEnums()
133 OS << "} // end namespace " << Namespace << "\n"; in runEnums()
142 OS << "\n// Register classes\n\n"; in runEnums()
144 OS << "namespace " << Namespace << " {\n"; in runEnums()
145 OS << "enum {\n"; in runEnums()
147 OS << " " << RC.getName() << "RegClassID" in runEnums()
149 OS << "\n};\n"; in runEnums()
151 OS << "} // end namespace " << Namespace << "\n\n"; in runEnums()
158 OS << "\n// Register alternate name indices\n\n"; in runEnums()
160 OS << "namespace " << Namespace << " {\n"; in runEnums()
161 OS << "enum {\n"; in runEnums()
163 OS << " " << RegAltNameIndices[i]->getName() << ",\t// " << i << "\n"; in runEnums()
164 OS << " NUM_TARGET_REG_ALT_NAMES = " << RegAltNameIndices.size() << "\n"; in runEnums()
165 OS << "};\n"; in runEnums()
167 OS << "} // end namespace " << Namespace << "\n\n"; in runEnums()
172 OS << "\n// Subregister indices\n\n"; in runEnums()
175 OS << "namespace " << Namespace << " {\n"; in runEnums()
176 OS << "enum : uint16_t {\n NoSubRegister,\n"; in runEnums()
179 OS << " " << Idx.getName() << ",\t// " << ++i << "\n"; in runEnums()
180 OS << " NUM_TARGET_SUBREGS\n};\n"; in runEnums()
182 OS << "} // end namespace " << Namespace << "\n\n"; in runEnums()
185 OS << "// Register pressure sets enum.\n"; in runEnums()
187 OS << "namespace " << Namespace << " {\n"; in runEnums()
188 OS << "enum RegisterPressureSets {\n"; in runEnums()
192 OS << " " << RegUnits.Name << " = " << i << ",\n"; in runEnums()
194 OS << "};\n"; in runEnums()
196 OS << "} // end namespace " << Namespace << '\n'; in runEnums()
197 OS << '\n'; in runEnums()
199 OS << "} // end namespace llvm\n\n"; in runEnums()
200 OS << "#endif // GET_REGINFO_ENUM\n\n"; in runEnums()
203 static void printInt(raw_ostream &OS, int Val) { in printInt() argument
204 OS << Val; in printInt()
208 EmitRegUnitPressure(raw_ostream &OS, const CodeGenRegBank &RegBank, in EmitRegUnitPressure() argument
213 OS << "/// Get the weight in units of pressure for this register class.\n" in EmitRegUnitPressure()
219 OS << " {" << RC.getWeight(RegBank) << ", "; in EmitRegUnitPressure()
221 OS << '0'; in EmitRegUnitPressure()
225 OS << RegBank.getRegUnitSetWeight(RegUnits); in EmitRegUnitPressure()
227 OS << "}, \t// " << RC.getName() << "\n"; in EmitRegUnitPressure()
229 OS << " };\n" in EmitRegUnitPressure()
241 OS << "/// Get the weight in units of pressure for this register unit.\n" in EmitRegUnitPressure()
247 OS << " static const uint8_t RUWeightTable[] = {\n "; in EmitRegUnitPressure()
252 OS << RU.Weight << ", "; in EmitRegUnitPressure()
254 OS << "};\n" in EmitRegUnitPressure()
258 OS << " // All register units have unit weight.\n" in EmitRegUnitPressure()
261 OS << "}\n\n"; in EmitRegUnitPressure()
263 OS << "\n" in EmitRegUnitPressure()
268 OS << "// Get the name of this register unit pressure set.\n" in EmitRegUnitPressure()
276 OS << " \"" << RegUnits.Name << "\",\n"; in EmitRegUnitPressure()
278 OS << " };\n" in EmitRegUnitPressure()
282 OS << "// Get the register unit pressure limit for this dimension.\n" in EmitRegUnitPressure()
291 OS << " " << RegUnits.Weight << ", \t// " << i << ": " in EmitRegUnitPressure()
294 OS << " };\n" in EmitRegUnitPressure()
318 OS << "/// Table of pressure sets per register class or unit.\n" in EmitRegUnitPressure()
320 PSetsSeqs.emit(OS, printInt, "-1"); in EmitRegUnitPressure()
321 OS << "};\n\n"; in EmitRegUnitPressure()
323 OS << "/// Get the dimensions of register pressure impacted by this " in EmitRegUnitPressure()
328 OS << " static const " << getMinimalTypeForRange(PSetsSeqs.size() - 1, 32) in EmitRegUnitPressure()
331 OS << PSetsSeqs.get(PSets[i]) << ","; in EmitRegUnitPressure()
333 OS << "};\n" in EmitRegUnitPressure()
337 OS << "/// Get the dimensions of register pressure impacted by this " in EmitRegUnitPressure()
344 OS << " static const " << getMinimalTypeForRange(PSetsSeqs.size() - 1, 32) in EmitRegUnitPressure()
348 OS << PSetsSeqs.get(PSets[RegBank.getRegUnit(UnitIdx).RegClassUnitSetsIdx]) in EmitRegUnitPressure()
351 OS << "};\n" in EmitRegUnitPressure()
385 raw_ostream &OS, const std::deque<CodeGenRegister> &Regs, bool isCtor) { in EmitRegMappingTables() argument
411 OS << "// " << Namespace << " Dwarf<->LLVM register mappings.\n"; in EmitRegMappingTables()
416 OS << "extern const MCRegisterInfo::DwarfLLVMRegPair " << Namespace; in EmitRegMappingTables()
417 OS << (j == 0 ? "DwarfFlavour" : "EHFlavour"); in EmitRegMappingTables()
418 OS << i << "Dwarf2L[]"; in EmitRegMappingTables()
421 OS << " = {\n"; in EmitRegMappingTables()
436 OS << " { " << I->first << "U, " << getQualifiedName(I->second) in EmitRegMappingTables()
439 OS << "};\n"; in EmitRegMappingTables()
441 OS << ";\n"; in EmitRegMappingTables()
446 OS << "extern const unsigned " << Namespace in EmitRegMappingTables()
449 OS << " = array_lengthof(" << Namespace in EmitRegMappingTables()
453 OS << ";\n\n"; in EmitRegMappingTables()
485 OS << "extern const MCRegisterInfo::DwarfLLVMRegPair " << Namespace; in EmitRegMappingTables()
486 OS << (j == 0 ? "DwarfFlavour" : "EHFlavour"); in EmitRegMappingTables()
487 OS << i << "L2Dwarf[]"; in EmitRegMappingTables()
489 OS << " = {\n"; in EmitRegMappingTables()
498 OS << " { " << getQualifiedName(I->first) << ", " << RegNo in EmitRegMappingTables()
501 OS << "};\n"; in EmitRegMappingTables()
503 OS << ";\n"; in EmitRegMappingTables()
508 OS << "extern const unsigned " << Namespace in EmitRegMappingTables()
511 OS << " = array_lengthof(" << Namespace in EmitRegMappingTables()
514 OS << ";\n\n"; in EmitRegMappingTables()
520 raw_ostream &OS, const std::deque<CodeGenRegister> &Regs, bool isCtor) { in EmitRegMapping() argument
537 OS << " switch ("; in EmitRegMapping()
539 OS << "DwarfFlavour"; in EmitRegMapping()
541 OS << "EHFlavour"; in EmitRegMapping()
542 OS << ") {\n" in EmitRegMapping()
547 OS << " case " << i << ":\n"; in EmitRegMapping()
548 OS << " "; in EmitRegMapping()
550 OS << "RI->"; in EmitRegMapping()
555 OS << "mapDwarfRegsToLLVMRegs(" << Tmp << ", " << Tmp << "Size, "; in EmitRegMapping()
557 OS << "false"; in EmitRegMapping()
559 OS << "true"; in EmitRegMapping()
560 OS << ");\n"; in EmitRegMapping()
561 OS << " break;\n"; in EmitRegMapping()
563 OS << " }\n"; in EmitRegMapping()
568 OS << " switch ("; in EmitRegMapping()
570 OS << "DwarfFlavour"; in EmitRegMapping()
572 OS << "EHFlavour"; in EmitRegMapping()
573 OS << ") {\n" in EmitRegMapping()
578 OS << " case " << i << ":\n"; in EmitRegMapping()
579 OS << " "; in EmitRegMapping()
581 OS << "RI->"; in EmitRegMapping()
586 OS << "mapLLVMRegsToDwarfRegs(" << Tmp << ", " << Tmp << "Size, "; in EmitRegMapping()
588 OS << "false"; in EmitRegMapping()
590 OS << "true"; in EmitRegMapping()
591 OS << ");\n"; in EmitRegMapping()
592 OS << " break;\n"; in EmitRegMapping()
594 OS << " }\n"; in EmitRegMapping()
600 static void printBitVectorAsHex(raw_ostream &OS, in printBitVectorAsHex() argument
609 OS << format("0x%0*x, ", Digits, Value); in printBitVectorAsHex()
623 void print(raw_ostream &OS) { in print() argument
624 printBitVectorAsHex(OS, Values, 8); in print()
628 static void printSimpleValueType(raw_ostream &OS, MVT::SimpleValueType VT) { in printSimpleValueType() argument
629 OS << getEnumName(VT); in printSimpleValueType()
632 static void printSubRegIndex(raw_ostream &OS, const CodeGenSubRegIndex *Idx) { in printSubRegIndex() argument
633 OS << Idx->EnumValue; in printSubRegIndex()
676 static void printDiff16(raw_ostream &OS, uint16_t Val) { in printDiff16() argument
677 OS << Val; in printDiff16()
680 static void printMask(raw_ostream &OS, LaneBitmask Val) { in printMask() argument
681 OS << "LaneBitmask(0x" << PrintLaneMask(Val) << ')'; in printMask()
706 RegisterInfoEmitter::emitComposeSubRegIndices(raw_ostream &OS, in emitComposeSubRegIndices() argument
710 OS << "unsigned " << ClName in emitComposeSubRegIndices()
745 OS << " static const " << getMinimalTypeForRange(Rows.size(), 32) in emitComposeSubRegIndices()
748 OS << RowMap[i] << ", "; in emitComposeSubRegIndices()
749 OS << "\n };\n"; in emitComposeSubRegIndices()
753 OS << " static const " << getMinimalTypeForRange(SubRegIndicesSize + 1, 32) in emitComposeSubRegIndices()
756 OS << " { "; in emitComposeSubRegIndices()
759 OS << Rows[r][i]->getQualifiedName() << ", "; in emitComposeSubRegIndices()
761 OS << "0, "; in emitComposeSubRegIndices()
762 OS << "},\n"; in emitComposeSubRegIndices()
764 OS << " };\n\n"; in emitComposeSubRegIndices()
766 OS << " --IdxA; assert(IdxA < " << SubRegIndicesSize << ");\n" in emitComposeSubRegIndices()
769 OS << " return Rows[RowMap[IdxA]][IdxB];\n"; in emitComposeSubRegIndices()
771 OS << " return Rows[0][IdxB];\n"; in emitComposeSubRegIndices()
772 OS << "}\n\n"; in emitComposeSubRegIndices()
776 RegisterInfoEmitter::emitComposeSubRegIndexLaneMask(raw_ostream &OS, in emitComposeSubRegIndexLaneMask() argument
807 OS << " struct MaskRolOp {\n" in emitComposeSubRegIndexLaneMask()
814 OS << " "; in emitComposeSubRegIndexLaneMask()
818 printMask(OS << "{ ", P.Mask); in emitComposeSubRegIndexLaneMask()
819 OS << format(", %2u }, ", P.RotateLeft); in emitComposeSubRegIndexLaneMask()
821 OS << "{ LaneBitmask::getNone(), 0 }"; in emitComposeSubRegIndexLaneMask()
823 OS << ", "; in emitComposeSubRegIndexLaneMask()
824 OS << " // Sequence " << Idx << "\n"; in emitComposeSubRegIndexLaneMask()
827 OS << " };\n" in emitComposeSubRegIndexLaneMask()
830 OS << " "; in emitComposeSubRegIndexLaneMask()
832 OS << format("&LaneMaskComposeSequences[%u]", Idx); in emitComposeSubRegIndexLaneMask()
834 OS << ","; in emitComposeSubRegIndexLaneMask()
835 OS << " // to " << SubRegIndices[i].getName() << "\n"; in emitComposeSubRegIndexLaneMask()
837 OS << " };\n\n"; in emitComposeSubRegIndexLaneMask()
839 OS << "LaneBitmask " << ClName in emitComposeSubRegIndexLaneMask()
855 OS << "LaneBitmask " << ClName in emitComposeSubRegIndexLaneMask()
877 RegisterInfoEmitter::runMCDesc(raw_ostream &OS, CodeGenTarget &Target, in runMCDesc() argument
879 emitSourceFileHeader("MC Register Information", OS); in runMCDesc()
881 OS << "\n#ifdef GET_REGINFO_MC_DESC\n"; in runMCDesc()
882 OS << "#undef GET_REGINFO_MC_DESC\n\n"; in runMCDesc()
978 OS << "namespace llvm {\n\n"; in runMCDesc()
983 OS << "extern const MCPhysReg " << TargetName << "RegDiffLists[] = {\n"; in runMCDesc()
984 DiffSeqs.emit(OS, printDiff16); in runMCDesc()
985 OS << "};\n\n"; in runMCDesc()
988 OS << "extern const LaneBitmask " << TargetName << "LaneMaskLists[] = {\n"; in runMCDesc()
989 LaneMaskSeqs.emit(OS, printMask, "LaneBitmask::getAll()"); in runMCDesc()
990 OS << "};\n\n"; in runMCDesc()
993 OS << "extern const uint16_t " << TargetName << "SubRegIdxLists[] = {\n"; in runMCDesc()
994 SubRegIdxSeqs.emit(OS, printSubRegIndex); in runMCDesc()
995 OS << "};\n\n"; in runMCDesc()
998 OS << "extern const MCRegisterInfo::SubRegCoveredBits " in runMCDesc()
1000 OS << " { " << (uint16_t)-1 << ", " << (uint16_t)-1 << " },\n"; in runMCDesc()
1002 OS << " { " << Idx.Offset << ", " << Idx.Size << " },\t// " in runMCDesc()
1005 OS << "};\n\n"; in runMCDesc()
1009 RegStrings.emitStringLiteralDef(OS, Twine("extern const char ") + TargetName + in runMCDesc()
1012 OS << "extern const MCRegisterDesc " << TargetName in runMCDesc()
1014 OS << " { " << RegStrings.get("") << ", 0, 0, 0, 0, 0 },\n"; in runMCDesc()
1019 OS << " { " << RegStrings.get(std::string(Reg.getName())) << ", " in runMCDesc()
1026 OS << "};\n\n"; // End of register descriptors... in runMCDesc()
1030 OS << "extern const MCPhysReg " << TargetName << "RegUnitRoots[][2] = {\n"; in runMCDesc()
1035 OS << " { " << getQualifiedName(Roots.front()->TheDef); in runMCDesc()
1037 OS << ", " << getQualifiedName(Roots[r]->TheDef); in runMCDesc()
1038 OS << " },\n"; in runMCDesc()
1040 OS << "};\n\n"; in runMCDesc()
1045 OS << "namespace { // Register classes...\n"; in runMCDesc()
1059 OS << " // " << Name << " Register Class...\n" in runMCDesc()
1063 OS << getQualifiedName(Reg) << ", "; in runMCDesc()
1065 OS << "\n };\n\n"; in runMCDesc()
1067 OS << " // " << Name << " Bit set.\n" in runMCDesc()
1074 BVE.print(OS); in runMCDesc()
1075 OS << "\n };\n\n"; in runMCDesc()
1078 OS << "} // end anonymous namespace\n\n"; in runMCDesc()
1082 OS, Twine("extern const char ") + TargetName + "RegClassStrings[]"); in runMCDesc()
1084 OS << "extern const MCRegisterClass " << TargetName in runMCDesc()
1089 OS << " { " << RC.getName() << ", " << RC.getName() << "Bits, " in runMCDesc()
1097 OS << "};\n\n"; in runMCDesc()
1099 EmitRegMappingTables(OS, Regs, false); in runMCDesc()
1102 OS << "extern const uint16_t " << TargetName; in runMCDesc()
1103 OS << "RegEncodingTable[] = {\n"; in runMCDesc()
1105 OS << " 0,\n"; in runMCDesc()
1114 OS << " " << Value << ",\n"; in runMCDesc()
1116 OS << "};\n"; // End of HW encoding table in runMCDesc()
1119 OS << "static inline void Init" << TargetName in runMCDesc()
1133 EmitRegMapping(OS, Regs, false); in runMCDesc()
1135 OS << "}\n\n"; in runMCDesc()
1137 OS << "} // end namespace llvm\n\n"; in runMCDesc()
1138 OS << "#endif // GET_REGINFO_MC_DESC\n\n"; in runMCDesc()
1142 RegisterInfoEmitter::runTargetHeader(raw_ostream &OS, CodeGenTarget &Target, in runTargetHeader() argument
1144 emitSourceFileHeader("Register Information Header Fragment", OS); in runTargetHeader()
1146 OS << "\n#ifdef GET_REGINFO_HEADER\n"; in runTargetHeader()
1147 OS << "#undef GET_REGINFO_HEADER\n\n"; in runTargetHeader()
1152 OS << "#include \"llvm/CodeGen/TargetRegisterInfo.h\"\n\n"; in runTargetHeader()
1154 OS << "namespace llvm {\n\n"; in runTargetHeader()
1156 OS << "class " << TargetName << "FrameLowering;\n\n"; in runTargetHeader()
1158 OS << "struct " << ClassName << " : public TargetRegisterInfo {\n" in runTargetHeader()
1163 OS << " unsigned composeSubRegIndicesImpl" in runTargetHeader()
1172 OS << " const RegClassWeight &getRegClassWeight(" in runTargetHeader()
1193 OS << "namespace " << RegisterClasses.front().Namespace in runTargetHeader()
1200 OS << " extern const TargetRegisterClass " << Name << "RegClass;\n"; in runTargetHeader()
1202 OS << "} // end namespace " << RegisterClasses.front().Namespace << "\n\n"; in runTargetHeader()
1204 OS << "} // end namespace llvm\n\n"; in runTargetHeader()
1205 OS << "#endif // GET_REGINFO_HEADER\n\n"; in runTargetHeader()
1212 RegisterInfoEmitter::runTargetDesc(raw_ostream &OS, CodeGenTarget &Target, in runTargetDesc() argument
1214 emitSourceFileHeader("Target Register and Register Classes Information", OS); in runTargetDesc()
1216 OS << "\n#ifdef GET_REGINFO_TARGET_DESC\n"; in runTargetDesc()
1217 OS << "#undef GET_REGINFO_TARGET_DESC\n\n"; in runTargetDesc()
1219 OS << "namespace llvm {\n\n"; in runTargetDesc()
1222 OS << "extern const MCRegisterClass " << Target.getName() in runTargetDesc()
1254 OS << "\nstatic const MVT::SimpleValueType VTLists[] = {\n"; in runTargetDesc()
1255 VTSeqs.emit(OS, printSimpleValueType, "MVT::Other"); in runTargetDesc()
1256 OS << "};\n"; in runTargetDesc()
1259 OS << "\nstatic const char *const SubRegIndexNameTable[] = { \""; in runTargetDesc()
1262 OS << Idx.getName(); in runTargetDesc()
1263 OS << "\", \""; in runTargetDesc()
1265 OS << "\" };\n\n"; in runTargetDesc()
1268 OS << "\nstatic const LaneBitmask SubRegIndexLaneMaskTable[] = {\n " in runTargetDesc()
1271 printMask(OS << " ", Idx.LaneMask); in runTargetDesc()
1272 OS << ", // " << Idx.getName() << '\n'; in runTargetDesc()
1274 OS << " };\n\n"; in runTargetDesc()
1276 OS << "\n"; in runTargetDesc()
1280 OS << "\nstatic const TargetRegisterInfo::RegClassInfo RegClassInfos[]" in runTargetDesc()
1284 OS << " // Mode = " << M << " ("; in runTargetDesc()
1286 OS << "Default"; in runTargetDesc()
1288 OS << CGH.getMode(M).Name; in runTargetDesc()
1289 OS << ")\n"; in runTargetDesc()
1295 OS << " { " << RI.RegSize << ", " << RI.SpillSize << ", " in runTargetDesc()
1300 OS << ", VTLists+" << VTSeqs.get(VTs) << " }, // " in runTargetDesc()
1304 OS << "};\n"; in runTargetDesc()
1307 OS << "\nstatic const TargetRegisterClass *const " in runTargetDesc()
1335 OS << "static const uint32_t " << RC.getName() in runTargetDesc()
1337 printBitVectorAsHex(OS, RC.getSubClasses(), 32); in runTargetDesc()
1348 OS << "\n "; in runTargetDesc()
1349 printBitVectorAsHex(OS, MaskBV, 32); in runTargetDesc()
1350 OS << "// " << Idx.getName(); in runTargetDesc()
1353 OS << "\n};\n\n"; in runTargetDesc()
1356 OS << "static const uint16_t SuperRegIdxSeqs[] = {\n"; in runTargetDesc()
1358 SuperRegIdxSeqs.emit(OS, printSubRegIndex); in runTargetDesc()
1359 OS << "};\n\n"; in runTargetDesc()
1369 OS << "static const TargetRegisterClass *const " in runTargetDesc()
1372 OS << " &" << Super->getQualifiedName() << "RegClass,\n"; in runTargetDesc()
1373 OS << " nullptr\n};\n\n"; in runTargetDesc()
1379 OS << "\nstatic inline unsigned " << RC.getName() in runTargetDesc()
1387 OS << " static const MCPhysReg AltOrder" << oi << "[] = {"; in runTargetDesc()
1389 OS << (elem ? ", " : " ") << getQualifiedName(Elems[elem]); in runTargetDesc()
1390 OS << " };\n"; in runTargetDesc()
1393 OS << " const MCRegisterClass &MCR = " << Target.getName() in runTargetDesc()
1399 OS << "),\n ArrayRef<MCPhysReg>("; in runTargetDesc()
1401 OS << "),\n makeArrayRef(AltOrder" << oi; in runTargetDesc()
1402 OS << ")\n };\n const unsigned Select = " << RC.getName() in runTargetDesc()
1409 OS << "\nnamespace " << RegisterClasses.front().Namespace in runTargetDesc()
1413 OS << " extern const TargetRegisterClass " << RC.getName() in runTargetDesc()
1418 printMask(OS, RC.LaneMask); in runTargetDesc()
1419 OS << ",\n " << (unsigned)RC.AllocationPriority << ",\n " in runTargetDesc()
1425 OS << "NullRegClasses,\n "; in runTargetDesc()
1427 OS << RC.getName() << "Superclasses,\n "; in runTargetDesc()
1429 OS << "nullptr\n"; in runTargetDesc()
1431 OS << RC.getName() << "GetRawAllocationOrder\n"; in runTargetDesc()
1432 OS << " };\n\n"; in runTargetDesc()
1435 OS << "} // end namespace " << RegisterClasses.front().Namespace << "\n"; in runTargetDesc()
1438 OS << "\nnamespace {\n"; in runTargetDesc()
1439 OS << " const TargetRegisterClass *const RegisterClasses[] = {\n"; in runTargetDesc()
1441 OS << " &" << RC.getQualifiedName() << "RegClass,\n"; in runTargetDesc()
1442 OS << " };\n"; in runTargetDesc()
1443 OS << "} // end anonymous namespace\n"; in runTargetDesc()
1447 OS << "\nstatic const TargetRegisterInfoDesc " in runTargetDesc()
1449 OS << " { 0, false },\n"; in runTargetDesc()
1453 OS << " { "; in runTargetDesc()
1454 OS << Reg.CostPerUse << ", " in runTargetDesc()
1458 OS << "};\n"; // End of register descriptors... in runTargetDesc()
1467 emitComposeSubRegIndices(OS, RegBank, ClassName); in runTargetDesc()
1468 emitComposeSubRegIndexLaneMask(OS, RegBank, ClassName); in runTargetDesc()
1473 OS << "const TargetRegisterClass *" << ClassName in runTargetDesc()
1479 OS << " static const uint8_t Table["; in runTargetDesc()
1481 OS << " static const uint16_t Table["; in runTargetDesc()
1484 OS << RegisterClasses.size() << "][" << SubRegIndicesSize << "] = {\n"; in runTargetDesc()
1486 OS << " {\t// " << RC.getName() << "\n"; in runTargetDesc()
1489 OS << " " << SRC->EnumValue + 1 << ",\t// " << Idx.getName() in runTargetDesc()
1492 OS << " 0,\t// " << Idx.getName() << "\n"; in runTargetDesc()
1494 OS << " },\n"; in runTargetDesc()
1496 OS << " };\n assert(RC && \"Missing regclass\");\n" in runTargetDesc()
1503 EmitRegUnitPressure(OS, RegBank, ClassName); in runTargetDesc()
1506 OS << "extern const MCRegisterDesc " << TargetName << "RegDesc[];\n"; in runTargetDesc()
1507 OS << "extern const MCPhysReg " << TargetName << "RegDiffLists[];\n"; in runTargetDesc()
1508 OS << "extern const LaneBitmask " << TargetName << "LaneMaskLists[];\n"; in runTargetDesc()
1509 OS << "extern const char " << TargetName << "RegStrings[];\n"; in runTargetDesc()
1510 OS << "extern const char " << TargetName << "RegClassStrings[];\n"; in runTargetDesc()
1511 OS << "extern const MCPhysReg " << TargetName << "RegUnitRoots[][2];\n"; in runTargetDesc()
1512 OS << "extern const uint16_t " << TargetName << "SubRegIdxLists[];\n"; in runTargetDesc()
1513 OS << "extern const MCRegisterInfo::SubRegCoveredBits " in runTargetDesc()
1515 OS << "extern const uint16_t " << TargetName << "RegEncodingTable[];\n"; in runTargetDesc()
1517 EmitRegMappingTables(OS, Regs, true); in runTargetDesc()
1519 OS << ClassName << "::\n" << ClassName in runTargetDesc()
1526 printMask(OS, RegBank.CoveringLanes); in runTargetDesc()
1527 OS << ", RegClassInfos, HwMode) {\n" in runTargetDesc()
1542 EmitRegMapping(OS, Regs, true); in runTargetDesc()
1544 OS << "}\n\n"; in runTargetDesc()
1555 OS << "static const MCPhysReg " << CSRSet->getName() in runTargetDesc()
1558 OS << getQualifiedName((*Regs)[r]) << ", "; in runTargetDesc()
1559 OS << "0 };\n"; in runTargetDesc()
1574 OS << "static const uint32_t " << CSRSet->getName() in runTargetDesc()
1576 printBitVectorAsHex(OS, Covered, 32); in runTargetDesc()
1577 OS << "};\n"; in runTargetDesc()
1579 OS << "\n\n"; in runTargetDesc()
1581 OS << "ArrayRef<const uint32_t *> " << ClassName in runTargetDesc()
1584 OS << " static const uint32_t *const Masks[] = {\n"; in runTargetDesc()
1586 OS << " " << CSRSet->getName() << "_RegMask,\n"; in runTargetDesc()
1587 OS << " };\n"; in runTargetDesc()
1588 OS << " return makeArrayRef(Masks);\n"; in runTargetDesc()
1590 OS << " return None;\n"; in runTargetDesc()
1592 OS << "}\n\n"; in runTargetDesc()
1594 OS << "ArrayRef<const char *> " << ClassName in runTargetDesc()
1597 OS << " static const char *const Names[] = {\n"; in runTargetDesc()
1599 OS << " " << '"' << CSRSet->getName() << '"' << ",\n"; in runTargetDesc()
1600 OS << " };\n"; in runTargetDesc()
1601 OS << " return makeArrayRef(Names);\n"; in runTargetDesc()
1603 OS << " return None;\n"; in runTargetDesc()
1605 OS << "}\n\n"; in runTargetDesc()
1607 OS << "const " << TargetName << "FrameLowering *\n" << TargetName in runTargetDesc()
1613 OS << "} // end namespace llvm\n\n"; in runTargetDesc()
1614 OS << "#endif // GET_REGINFO_TARGET_DESC\n\n"; in runTargetDesc()
1617 void RegisterInfoEmitter::run(raw_ostream &OS) { in run() argument
1620 runEnums(OS, Target, RegBank); in run()
1623 runMCDesc(OS, Target, RegBank); in run()
1626 runTargetHeader(OS, Target, RegBank); in run()
1629 runTargetDesc(OS, Target, RegBank); in run()
1635 void RegisterInfoEmitter::debugDump(raw_ostream &OS) { in debugDump() argument
1646 OS << "RegisterClass " << RC.getName() << ":\n"; in debugDump()
1647 OS << "\tSpillSize: {"; in debugDump()
1649 OS << ' ' << getModeName(M) << ':' << RC.RSI.get(M).SpillSize; in debugDump()
1650 OS << " }\n\tSpillAlignment: {"; in debugDump()
1652 OS << ' ' << getModeName(M) << ':' << RC.RSI.get(M).SpillAlignment; in debugDump()
1653 OS << " }\n\tNumRegs: " << RC.getMembers().size() << '\n'; in debugDump()
1654 OS << "\tLaneMask: " << PrintLaneMask(RC.LaneMask) << '\n'; in debugDump()
1655 OS << "\tHasDisjunctSubRegs: " << RC.HasDisjunctSubRegs << '\n'; in debugDump()
1656 OS << "\tCoveredBySubRegs: " << RC.CoveredBySubRegs << '\n'; in debugDump()
1657 OS << "\tRegs:"; in debugDump()
1659 OS << " " << R->getName(); in debugDump()
1661 OS << '\n'; in debugDump()
1662 OS << "\tSubClasses:"; in debugDump()
1667 OS << " " << SRC.getName(); in debugDump()
1669 OS << '\n'; in debugDump()
1670 OS << "\tSuperClasses:"; in debugDump()
1672 OS << " " << SRC->getName(); in debugDump()
1674 OS << '\n'; in debugDump()
1678 OS << "SubRegIndex " << SRI.getName() << ":\n"; in debugDump()
1679 OS << "\tLaneMask: " << PrintLaneMask(SRI.LaneMask) << '\n'; in debugDump()
1680 OS << "\tAllSuperRegsCovered: " << SRI.AllSuperRegsCovered << '\n'; in debugDump()
1684 OS << "Register " << R.getName() << ":\n"; in debugDump()
1685 OS << "\tCostPerUse: " << R.CostPerUse << '\n'; in debugDump()
1686 OS << "\tCoveredBySubregs: " << R.CoveredBySubRegs << '\n'; in debugDump()
1687 OS << "\tHasDisjunctSubRegs: " << R.HasDisjunctSubRegs << '\n'; in debugDump()
1689 OS << "\tSubReg " << P.first->getName() in debugDump()
1697 void EmitRegisterInfo(RecordKeeper &RK, raw_ostream &OS) { in EmitRegisterInfo() argument
1698 RegisterInfoEmitter(RK).run(OS); in EmitRegisterInfo()