44#define DEBUG_TYPE "reginfo"
46#define GET_REGINFO_TARGET_DESC
47#include "PPCGenRegisterInfo.inc"
49STATISTIC(InflateGPRC,
"Number of gprc inputs for getLargestLegalClass");
50STATISTIC(InflateGP8RC,
"Number of g8rc inputs for getLargestLegalClass");
54 cl::desc(
"Enable use of a base pointer for complex stack frames"));
58 cl::desc(
"Force the use of a base pointer in every function"));
62 cl::desc(
"Enable spills from gpr to vsr rather than stack"));
66 cl::desc(
"Consider R1 caller preserved so stack saves of "
67 "caller preserved registers can be LICM candidates"),
72 cl::desc(
"Maximum search distance for definition of CR bit "
86 cl::desc(
"Emit information about accumulator register spills "
98 TM.isPPC64() ? 0 : 1),
100 ImmToIdxMap[PPC::LD] = PPC::LDX; ImmToIdxMap[PPC::STD] = PPC::STDX;
101 ImmToIdxMap[PPC::LBZ] = PPC::LBZX; ImmToIdxMap[PPC::STB] = PPC::STBX;
102 ImmToIdxMap[PPC::LHZ] = PPC::LHZX; ImmToIdxMap[PPC::LHA] = PPC::LHAX;
103 ImmToIdxMap[PPC::LWZ] = PPC::LWZX; ImmToIdxMap[PPC::LWA] = PPC::LWAX;
104 ImmToIdxMap[PPC::LFS] = PPC::LFSX; ImmToIdxMap[PPC::LFD] = PPC::LFDX;
105 ImmToIdxMap[PPC::STH] = PPC::STHX; ImmToIdxMap[PPC::STW] = PPC::STWX;
106 ImmToIdxMap[PPC::STFS] = PPC::STFSX; ImmToIdxMap[PPC::STFD] = PPC::STFDX;
107 ImmToIdxMap[PPC::ADDI] = PPC::ADD4;
108 ImmToIdxMap[PPC::LWA_32] = PPC::LWAX_32;
111 ImmToIdxMap[PPC::LHA8] = PPC::LHAX8; ImmToIdxMap[PPC::LBZ8] = PPC::LBZX8;
112 ImmToIdxMap[PPC::LHZ8] = PPC::LHZX8; ImmToIdxMap[PPC::LWZ8] = PPC::LWZX8;
113 ImmToIdxMap[PPC::STB8] = PPC::STBX8; ImmToIdxMap[PPC::STH8] = PPC::STHX8;
114 ImmToIdxMap[PPC::STW8] = PPC::STWX8; ImmToIdxMap[PPC::STDU] = PPC::STDUX;
115 ImmToIdxMap[PPC::ADDI8] = PPC::ADD8;
116 ImmToIdxMap[PPC::LQ] = PPC::LQX_PSEUDO;
117 ImmToIdxMap[PPC::STQ] = PPC::STQX_PSEUDO;
120 ImmToIdxMap[PPC::DFLOADf32] = PPC::LXSSPX;
121 ImmToIdxMap[PPC::DFLOADf64] = PPC::LXSDX;
122 ImmToIdxMap[PPC::SPILLTOVSR_LD] = PPC::SPILLTOVSR_LDX;
123 ImmToIdxMap[PPC::SPILLTOVSR_ST] = PPC::SPILLTOVSR_STX;
124 ImmToIdxMap[PPC::DFSTOREf32] = PPC::STXSSPX;
125 ImmToIdxMap[PPC::DFSTOREf64] = PPC::STXSDX;
126 ImmToIdxMap[PPC::LXV] = PPC::LXVX;
127 ImmToIdxMap[PPC::LXSD] = PPC::LXSDX;
128 ImmToIdxMap[PPC::LXSSP] = PPC::LXSSPX;
129 ImmToIdxMap[PPC::STXV] = PPC::STXVX;
130 ImmToIdxMap[PPC::STXSD] = PPC::STXSDX;
131 ImmToIdxMap[PPC::STXSSP] = PPC::STXSSPX;
134 ImmToIdxMap[PPC::EVLDD] = PPC::EVLDDX;
135 ImmToIdxMap[PPC::EVSTDD] = PPC::EVSTDDX;
136 ImmToIdxMap[PPC::SPESTW] = PPC::SPESTWX;
137 ImmToIdxMap[PPC::SPELWZ] = PPC::SPELWZX;
140 ImmToIdxMap[PPC::PLBZ] = PPC::LBZX; ImmToIdxMap[PPC::PLBZ8] = PPC::LBZX8;
141 ImmToIdxMap[PPC::PLHZ] = PPC::LHZX; ImmToIdxMap[PPC::PLHZ8] = PPC::LHZX8;
142 ImmToIdxMap[PPC::PLHA] = PPC::LHAX; ImmToIdxMap[PPC::PLHA8] = PPC::LHAX8;
143 ImmToIdxMap[PPC::PLWZ] = PPC::LWZX; ImmToIdxMap[PPC::PLWZ8] = PPC::LWZX8;
144 ImmToIdxMap[PPC::PLWA] = PPC::LWAX; ImmToIdxMap[PPC::PLWA8] = PPC::LWAX;
145 ImmToIdxMap[PPC::PLD] = PPC::LDX; ImmToIdxMap[PPC::PSTD] = PPC::STDX;
147 ImmToIdxMap[PPC::PSTB] = PPC::STBX; ImmToIdxMap[PPC::PSTB8] = PPC::STBX8;
148 ImmToIdxMap[PPC::PSTH] = PPC::STHX; ImmToIdxMap[PPC::PSTH8] = PPC::STHX8;
149 ImmToIdxMap[PPC::PSTW] = PPC::STWX; ImmToIdxMap[PPC::PSTW8] = PPC::STWX8;
151 ImmToIdxMap[PPC::PLFS] = PPC::LFSX; ImmToIdxMap[PPC::PSTFS] = PPC::STFSX;
152 ImmToIdxMap[PPC::PLFD] = PPC::LFDX; ImmToIdxMap[PPC::PSTFD] = PPC::STFDX;
153 ImmToIdxMap[PPC::PLXSSP] = PPC::LXSSPX; ImmToIdxMap[PPC::PSTXSSP] = PPC::STXSSPX;
154 ImmToIdxMap[PPC::PLXSD] = PPC::LXSDX; ImmToIdxMap[PPC::PSTXSD] = PPC::STXSDX;
155 ImmToIdxMap[PPC::PLXV] = PPC::LXVX; ImmToIdxMap[PPC::PSTXV] = PPC::STXVX;
157 ImmToIdxMap[PPC::LXVP] = PPC::LXVPX;
158 ImmToIdxMap[PPC::STXVP] = PPC::STXVPX;
159 ImmToIdxMap[PPC::PLXVP] = PPC::LXVPX;
160 ImmToIdxMap[PPC::PSTXVP] = PPC::STXVPX;
167 if (!TM.isPPC64() && Subtarget.
isAIXABI())
169 if (Subtarget.hasVSX()) {
170 if (Subtarget.pairedVectorMemops())
171 return CSR_64_AllRegs_VSRP_SaveList;
173 return CSR_64_AllRegs_AIX_Dflt_VSX_SaveList;
174 return CSR_64_AllRegs_VSX_SaveList;
176 if (Subtarget.hasAltivec()) {
178 return CSR_64_AllRegs_AIX_Dflt_Altivec_SaveList;
179 return CSR_64_AllRegs_Altivec_SaveList;
181 return CSR_64_AllRegs_SaveList;
199 if (Subtarget.pairedVectorMemops())
200 return SaveR2 ? CSR_SVR64_ColdCC_R2_VSRP_SaveList
201 : CSR_SVR64_ColdCC_VSRP_SaveList;
202 if (Subtarget.hasAltivec())
203 return SaveR2 ? CSR_SVR64_ColdCC_R2_Altivec_SaveList
204 : CSR_SVR64_ColdCC_Altivec_SaveList;
205 return SaveR2 ? CSR_SVR64_ColdCC_R2_SaveList
206 : CSR_SVR64_ColdCC_SaveList;
209 if (Subtarget.pairedVectorMemops())
210 return CSR_SVR32_ColdCC_VSRP_SaveList;
211 else if (Subtarget.hasAltivec())
212 return CSR_SVR32_ColdCC_Altivec_SaveList;
213 else if (Subtarget.hasSPE())
214 return CSR_SVR32_ColdCC_SPE_SaveList;
215 return CSR_SVR32_ColdCC_SaveList;
219 if (Subtarget.pairedVectorMemops()) {
222 return SaveR2 ? CSR_PPC64_R2_SaveList : CSR_PPC64_SaveList;
223 return SaveR2 ? CSR_AIX64_R2_VSRP_SaveList : CSR_AIX64_VSRP_SaveList;
225 return SaveR2 ? CSR_SVR464_R2_VSRP_SaveList : CSR_SVR464_VSRP_SaveList;
227 if (Subtarget.hasAltivec() &&
229 return SaveR2 ? CSR_PPC64_R2_Altivec_SaveList
230 : CSR_PPC64_Altivec_SaveList;
232 return SaveR2 ? CSR_PPC64_R2_SaveList : CSR_PPC64_SaveList;
236 if (Subtarget.pairedVectorMemops())
238 : CSR_AIX32_SaveList;
239 if (Subtarget.hasAltivec())
241 : CSR_AIX32_SaveList;
242 return CSR_AIX32_SaveList;
244 if (Subtarget.pairedVectorMemops())
245 return CSR_SVR432_VSRP_SaveList;
246 if (Subtarget.hasAltivec())
247 return CSR_SVR432_Altivec_SaveList;
248 else if (Subtarget.hasSPE()) {
249 if (TM.isPositionIndependent() && !TM.isPPC64())
250 return CSR_SVR432_SPE_NO_S30_31_SaveList;
251 return CSR_SVR432_SPE_SaveList;
253 return CSR_SVR432_SaveList;
261 if (Subtarget.hasVSX()) {
262 if (Subtarget.pairedVectorMemops())
263 return CSR_64_AllRegs_VSRP_RegMask;
265 return CSR_64_AllRegs_AIX_Dflt_VSX_RegMask;
266 return CSR_64_AllRegs_VSX_RegMask;
268 if (Subtarget.hasAltivec()) {
270 return CSR_64_AllRegs_AIX_Dflt_Altivec_RegMask;
271 return CSR_64_AllRegs_Altivec_RegMask;
273 return CSR_64_AllRegs_RegMask;
277 if (Subtarget.pairedVectorMemops()) {
279 return TM.isPPC64() ? CSR_PPC64_RegMask : CSR_AIX32_RegMask;
280 return TM.isPPC64() ? CSR_AIX64_VSRP_RegMask : CSR_AIX32_VSRP_RegMask;
282 return TM.isPPC64() ? ((Subtarget.hasAltivec() &&
284 ? CSR_PPC64_Altivec_RegMask
286 : ((Subtarget.hasAltivec() &&
288 ? CSR_AIX32_Altivec_RegMask
289 : CSR_AIX32_RegMask);
294 return Subtarget.pairedVectorMemops()
295 ? CSR_SVR64_ColdCC_VSRP_RegMask
296 : (Subtarget.hasAltivec() ? CSR_SVR64_ColdCC_Altivec_RegMask
297 : CSR_SVR64_ColdCC_RegMask);
299 return Subtarget.pairedVectorMemops()
300 ? CSR_SVR32_ColdCC_VSRP_RegMask
301 : (Subtarget.hasAltivec()
302 ? CSR_SVR32_ColdCC_Altivec_RegMask
303 : (Subtarget.hasSPE() ? CSR_SVR32_ColdCC_SPE_RegMask
304 : CSR_SVR32_ColdCC_RegMask));
308 return Subtarget.pairedVectorMemops()
309 ? CSR_SVR464_VSRP_RegMask
310 : (Subtarget.hasAltivec() ? CSR_PPC64_Altivec_RegMask
311 : CSR_PPC64_RegMask);
313 return Subtarget.pairedVectorMemops()
314 ? CSR_SVR432_VSRP_RegMask
315 : (Subtarget.hasAltivec()
316 ? CSR_SVR432_Altivec_RegMask
317 : (Subtarget.hasSPE()
318 ? (TM.isPositionIndependent()
319 ? CSR_SVR432_SPE_NO_S30_31_RegMask
320 : CSR_SVR432_SPE_RegMask)
321 : CSR_SVR432_RegMask));
326 return CSR_NoRegs_RegMask;
330 for (
unsigned PseudoReg : {PPC::ZERO, PPC::ZERO8, PPC::RM})
331 Mask[PseudoReg / 32] &= ~(1u << (PseudoReg % 32));
361 markSuperRegs(
Reserved, PPC::VRSAVE);
372 if (!TM.isPPC64() || UsesTOCBasePtr || MF.
hasInlineAsm())
383 if (TFI->needsFP(MF))
386 bool IsPositionIndependent = TM.isPositionIndependent();
398 if (!Subtarget.hasAltivec())
402 if (Subtarget.
isAIXABI() && Subtarget.hasAltivec() &&
406 for (
auto Reg : CSR_Altivec_SaveList) {
423 if (PhysReg == PPC::CTR || PhysReg == PPC::CTR8 || PhysReg == PPC::LR ||
449 if (FrameSize & ~0x7FFF) {
450 LLVM_DEBUG(
dbgs() <<
"TRUE - Frame size is too large for D-Form.\n");
459 if (CSI.isSpilledToReg())
462 int FrIdx = CSI.getFrameIdx();
466 unsigned Opcode = InstrInfo->getStoreOpcodeForSpill(RC);
471 LLVM_DEBUG(
dbgs() <<
"Memory Operand: " << InstrInfo->getName(Opcode)
472 <<
" for register " <<
printReg(Reg,
this) <<
".\n");
473 LLVM_DEBUG(
dbgs() <<
"TRUE - Not fixed frame object that requires "
485 if (InstrInfo->isXFormMemOp(Opcode)) {
486 LLVM_DEBUG(
dbgs() <<
"Memory Operand: " << InstrInfo->getName(Opcode)
487 <<
" for register " <<
printReg(Reg,
this) <<
".\n");
493 if ((Opcode == PPC::RESTORE_QUADWORD) || (Opcode == PPC::SPILL_QUADWORD)) {
494 LLVM_DEBUG(
dbgs() <<
"Memory Operand: " << InstrInfo->getName(Opcode)
495 <<
" for register " <<
printReg(Reg,
this) <<
".\n");
511 return !Subtarget.hasROPProtect();
529 !MFI.hasVarSizedObjects() && !MFI.hasOpaqueSPAdjustment())
553 VirtReg, Order, Hints, MF, VRM,
Matrix);
559 return BaseImplRetVal;
570 switch (
Use.getOpcode()) {
571 case TargetOpcode::COPY: {
572 ResultOp = &
Use.getOperand(0);
573 ResultReg = ResultOp->
getReg();
579 if (RegClass->
contains(PPC::VSRp0)) {
580 HintReg = getSubReg(UACCPhys, ResultOp->
getSubReg());
582 if (HintReg >= PPC::VSRp0 && HintReg <= PPC::VSRp31)
584 }
else if (RegClass->
contains(PPC::ACC0)) {
585 HintReg = PPC::ACC0 + (UACCPhys - PPC::UACC0);
586 if (HintReg >= PPC::ACC0 && HintReg <= PPC::ACC7)
592 case PPC::BUILD_UACC: {
593 ResultOp = &
Use.getOperand(0);
594 ResultReg = ResultOp->
getReg();
598 assert((ACCPhys >= PPC::ACC0 && ACCPhys <= PPC::ACC7) &&
599 "Expecting an ACC register for BUILD_UACC.");
600 Register HintReg = PPC::UACC0 + (ACCPhys - PPC::ACC0);
607 return BaseImplRetVal;
612 if (RC == &PPC::CARRYRCRegClass)
613 return TM.isPPC64() ? &PPC::G8RCRegClass : &PPC::GPRCRegClass;
620 const unsigned DefaultSafety = 1;
622 switch (RC->
getID()) {
625 case PPC::G8RC_NOX0RegClassID:
626 case PPC::GPRC_NOR0RegClassID:
627 case PPC::SPERCRegClassID:
628 case PPC::G8RCRegClassID:
629 case PPC::GPRCRegClassID: {
630 unsigned FP = TFI->
hasFP(MF) ? 1 : 0;
631 return 32 -
FP - DefaultSafety;
633 case PPC::F4RCRegClassID:
634 case PPC::F8RCRegClassID:
635 case PPC::VSLRCRegClassID:
636 return 32 - DefaultSafety;
637 case PPC::VFRCRegClassID:
638 case PPC::VRRCRegClassID: {
643 return 20 - DefaultSafety;
645 return 32 - DefaultSafety;
646 case PPC::VSFRCRegClassID:
647 case PPC::VSSRCRegClassID:
648 case PPC::VSRCRegClassID: {
653 return 52 - DefaultSafety;
655 return 64 - DefaultSafety;
656 case PPC::CRRCRegClassID:
657 return 8 - DefaultSafety;
665 const auto *DefaultSuperclass =
667 if (Subtarget.hasVSX()) {
676 RC == &PPC::G8RCRegClass) {
678 return &PPC::SPILLTOVSRRCRegClass;
685 if (getRegSizeInBits(*
getRegClass(SuperID)) != getRegSizeInBits(*RC))
689 case PPC::VSSRCRegClassID:
690 return Subtarget.hasP8Vector() ?
getRegClass(SuperID)
692 case PPC::VSFRCRegClassID:
693 case PPC::VSRCRegClassID:
695 case PPC::VSRpRCRegClassID:
696 return Subtarget.pairedVectorMemops() ?
getRegClass(SuperID)
698 case PPC::ACCRCRegClassID:
699 case PPC::UACCRCRegClassID:
700 return Subtarget.hasMMA() ?
getRegClass(SuperID) : DefaultSuperclass;
705 return DefaultSuperclass;
732 bool LP64 = TM.isPPC64();
739 "Maximum call-frame size not sufficiently aligned");
745 bool KillNegSizeReg =
MI.getOperand(1).isKill();
746 Register NegSizeReg =
MI.getOperand(1).getReg();
758 .
addImm(maxCallFrameSize);
766 .
addImm(maxCallFrameSize);
778 bool &KillNegSizeReg,
792 bool LP64 = TM.isPPC64();
811 if (MaxAlign < TargetAlign &&
isInt<16>(FrameSize)) {
831 if (MaxAlign > TargetAlign) {
832 unsigned UnalNegSizeReg = NegSizeReg;
840 unsigned NegSizeReg1 = NegSizeReg;
845 KillNegSizeReg =
true;
848 if (MaxAlign > TargetAlign) {
849 unsigned UnalNegSizeReg = NegSizeReg;
857 unsigned NegSizeReg1 = NegSizeReg;
862 KillNegSizeReg =
true;
878 bool LP64 = TM.isPPC64();
880 Register FramePointer =
MI.getOperand(0).getReg();
881 const Register ActualNegSizeReg =
MI.getOperand(1).getReg();
882 bool KillNegSizeReg =
MI.getOperand(2).isKill();
883 Register NegSizeReg =
MI.getOperand(2).getReg();
886 if (FramePointer == NegSizeReg) {
887 assert(KillNegSizeReg &&
"FramePointer is a def and NegSizeReg is an use, "
888 "NegSizeReg should be killed");
895 NegSizeReg = ActualNegSizeReg;
896 KillNegSizeReg =
false;
901 if (NegSizeReg != ActualNegSizeReg)
926 MI.getOperand(0).getReg())
927 .
addImm(maxCallFrameSize);
940 unsigned FrameIndex)
const {
950 bool LP64 = TM.isPPC64();
964 if (SrcReg != PPC::CR0) {
971 .
addImm(getEncodingValue(SrcReg) * 4)
985 unsigned FrameIndex)
const {
995 bool LP64 = TM.isPPC64();
1000 Register DestReg =
MI.getOperand(0).getReg();
1001 assert(
MI.definesRegister(DestReg,
nullptr) &&
1002 "RESTORE_CR does not define its destination");
1009 if (DestReg != PPC::CR0) {
1013 unsigned ShiftBits = getEncodingValue(DestReg)*4;
1020 BuildMI(
MBB,
II, dl,
TII.get(LP64 ? PPC::MTOCRF8 : PPC::MTOCRF), DestReg)
1028 unsigned FrameIndex)
const {
1039 bool LP64 = TM.isPPC64();
1050 unsigned CRBitSpillDistance = 0;
1051 bool SeenUse =
false;
1052 for (; Ins != Rend; ++Ins) {
1054 if (Ins->modifiesRegister(SrcReg,
TRI))
1057 if (Ins->readsRegister(SrcReg,
TRI))
1065 if (!Ins->isDebugInstr())
1066 CRBitSpillDistance++;
1070 if (Ins ==
MBB.rend())
1073 bool SpillsKnownBit =
false;
1075 switch (Ins->getOpcode()) {
1079 SpillsKnownBit =
true;
1084 SpillsKnownBit =
true;
1096 if (Subtarget.isISA3_1()) {
1108 if (Subtarget.isISA3_0()) {
1109 if (SrcReg == PPC::CR0LT || SrcReg == PPC::CR1LT ||
1110 SrcReg == PPC::CR2LT || SrcReg == PPC::CR3LT ||
1111 SrcReg == PPC::CR4LT || SrcReg == PPC::CR5LT ||
1112 SrcReg == PPC::CR6LT || SrcReg == PPC::CR7LT) {
1135 .
addImm(getEncodingValue(SrcReg))
1142 bool KillsCRBit =
MI.killsRegister(SrcReg,
TRI);
1145 if (SpillsKnownBit && KillsCRBit && !SeenUse) {
1146 Ins->setDesc(
TII.get(PPC::UNENCODED_NOP));
1147 Ins->removeOperand(0);
1152 unsigned FrameIndex)
const {
1162 bool LP64 = TM.isPPC64();
1167 Register DestReg =
MI.getOperand(0).getReg();
1168 assert(
MI.definesRegister(DestReg,
nullptr) &&
1169 "RESTORE_CRBIT does not define its destination");
1177 BuildMI(
MBB,
II, dl,
TII.get(LP64 ? PPC::MFOCRF8 : PPC::MFOCRF), RegO)
1180 unsigned ShiftBits = getEncodingValue(DestReg);
1182 BuildMI(
MBB,
II, dl,
TII.get(LP64 ? PPC::RLWIMI8 : PPC::RLWIMI), RegO)
1185 .
addImm(ShiftBits ? 32 - ShiftBits : 0)
1207 std::string Dest = PPC::ACCRCRegClass.contains(DestReg) ?
"acc" :
"uacc";
1208 std::string Src = PPC::ACCRCRegClass.contains(SrcReg) ?
"acc" :
"uacc";
1209 dbgs() <<
"Emitting copy from " << Src <<
" to " << Dest <<
":\n";
1221 dbgs() <<
"Emitting " << (IsPrimed ?
"acc" :
"uacc") <<
" register "
1222 << (IsRestore ?
"restore" :
"spill") <<
":\n";
1231 unsigned FrameIndex,
bool IsLittleEndian,
1237 "Spilling register pairs does not support virtual registers.");
1249 FrameIndex, IsLittleEndian ?
Offset - 16 :
Offset + 16);
1256 unsigned FrameIndex)
const {
1258 "Expecting to do this only if paired vector stores are disabled.");
1267 bool IsKilled =
MI.getOperand(0).isKill();
1269 spillRegPair(
MBB,
II,
DL,
TII, FrameIndex, IsLittleEndian, IsKilled, SrcReg,
1270 IsLittleEndian ? 16 : 0);
1281 dbgs() <<
"Emitting wacc register " << (IsRestore ?
"restore" :
"spill")
1294 unsigned FrameIndex)
const {
1302 bool IsKilled =
MI.getOperand(0).isKill();
1304 bool IsPrimed = PPC::ACCRCRegClass.contains(SrcReg);
1316 spillRegPair(
MBB,
II,
DL,
TII, FrameIndex, IsLittleEndian, IsKilled,
1318 IsLittleEndian ? 48 : 0);
1319 spillRegPair(
MBB,
II,
DL,
TII, FrameIndex, IsLittleEndian, IsKilled,
1321 IsLittleEndian ? 16 : 32);
1327 FrameIndex, IsLittleEndian ? 32 : 0);
1332 FrameIndex, IsLittleEndian ? 0 : 32);
1334 if (IsPrimed && !IsKilled)
1343 unsigned FrameIndex)
const {
1351 Register DestReg =
MI.getOperand(0).getReg();
1352 assert(
MI.definesRegister(DestReg,
nullptr) &&
1353 "RESTORE_ACC does not define its destination");
1355 bool IsPrimed = PPC::ACCRCRegClass.contains(DestReg);
1357 PPC::VSRp0 + (DestReg - (IsPrimed ? PPC::ACC0 : PPC::UACC0)) * 2;
1365 FrameIndex, IsLittleEndian ? 32 : 0);
1367 FrameIndex, IsLittleEndian ? 0 : 32);
1378 unsigned FrameIndex)
const {
1400 FrameIndex, IsLittleEndian ? 32 : 0);
1403 FrameIndex, IsLittleEndian ? 0 : 32);
1412 unsigned FrameIndex)
const {
1426 Register DestReg =
MI.getOperand(0).getReg();
1429 FrameIndex, IsLittleEndian ? 32 : 0);
1431 FrameIndex, IsLittleEndian ? 0 : 32);
1444 unsigned FrameIndex)
const {
1453 bool IsKilled =
MI.getOperand(0).isKill();
1455 Register Reg = PPC::X0 + (SrcReg - PPC::G8p0) * 2;
1460 FrameIndex, IsLittleEndian ? 8 : 0);
1463 FrameIndex, IsLittleEndian ? 0 : 8);
1471 unsigned FrameIndex)
const {
1479 Register DestReg =
MI.getOperand(0).getReg();
1480 assert(
MI.definesRegister(DestReg,
nullptr) &&
1481 "RESTORE_QUADWORD does not define its destination");
1483 Register Reg = PPC::X0 + (DestReg - PPC::G8p0) * 2;
1487 IsLittleEndian ? 8 : 0);
1489 IsLittleEndian ? 0 : 8);
1497 unsigned FrameIndex)
const {
1509 auto spillDMR = [&](
Register SrcReg,
int BEIdx,
int LEIdx) {
1510 auto spillWACC = [&](
unsigned Opc,
unsigned RegIdx,
int IdxBE,
int IdxLE) {
1520 FrameIndex, IsLittleEndian ? IdxLE : IdxBE);
1523 FrameIndex, IsLittleEndian ? IdxLE - 32 : IdxBE + 32);
1525 spillWACC(PPC::DMXXEXTFDMR512, PPC::sub_wacc_lo, BEIdx, LEIdx);
1526 spillWACC(PPC::DMXXEXTFDMR512_HI, PPC::sub_wacc_hi, BEIdx + 64, LEIdx - 64);
1530 if (
MI.getOpcode() == PPC::SPILL_DMRP) {
1534 spillDMR(SrcReg, 0, 96);
1542 unsigned FrameIndex)
const {
1552 auto restoreDMR = [&](
Register DestReg,
int BEIdx,
int LEIdx) {
1553 auto restoreWACC = [&](
unsigned Opc,
unsigned RegIdx,
int IdxBE,
1559 FrameIndex, IsLittleEndian ? IdxLE : IdxBE);
1561 FrameIndex, IsLittleEndian ? IdxLE - 32 : IdxBE + 32);
1569 restoreWACC(PPC::DMXXINSTDMR512, PPC::sub_wacc_lo, BEIdx, LEIdx);
1570 restoreWACC(PPC::DMXXINSTDMR512_HI, PPC::sub_wacc_hi, BEIdx + 64,
1574 Register DestReg =
MI.getOperand(0).getReg();
1575 if (
MI.getOpcode() == PPC::RESTORE_DMRP) {
1579 restoreDMR(DestReg, 0, 96);
1586 Register Reg,
int &FrameIdx)
const {
1595 if (PPC::CR2 <= Reg && Reg <= PPC::CR4) {
1613 case PPC::DFLOADf32:
1614 case PPC::DFLOADf64:
1615 case PPC::DFSTOREf32:
1616 case PPC::DFSTOREf64:
1637 unsigned OpC =
MI.getOpcode();
1643 unsigned FIOperandNum) {
1645 unsigned OffsetOperandNo = (FIOperandNum == 2) ? 1 : 2;
1646 if (
MI.isInlineAsm())
1647 OffsetOperandNo = FIOperandNum - 1;
1648 else if (
MI.getOpcode() == TargetOpcode::STACKMAP ||
1649 MI.getOpcode() == TargetOpcode::PATCHPOINT)
1650 OffsetOperandNo = FIOperandNum + 1;
1652 return OffsetOperandNo;
1657 int SPAdj,
unsigned FIOperandNum,
1659 assert(SPAdj == 0 &&
"Unexpected");
1677 int FrameIndex =
MI.getOperand(FIOperandNum).getIndex();
1684 unsigned OpC =
MI.getOpcode();
1689 case PPC::DYNAREAOFFSET:
1690 case PPC::DYNAREAOFFSET8:
1695 case PPC::DYNALLOC8: {
1697 if (FPSI && FrameIndex == FPSI) {
1703 case PPC::PREPARE_PROBED_ALLOCA_64:
1704 case PPC::PREPARE_PROBED_ALLOCA_32:
1705 case PPC::PREPARE_PROBED_ALLOCA_NEGSIZE_SAME_REG_64:
1706 case PPC::PREPARE_PROBED_ALLOCA_NEGSIZE_SAME_REG_32: {
1707 if (FPSI && FrameIndex == FPSI) {
1717 case PPC::RESTORE_CR:
1720 case PPC::SPILL_CRBIT:
1723 case PPC::RESTORE_CRBIT:
1726 case PPC::SPILL_ACC:
1727 case PPC::SPILL_UACC:
1730 case PPC::RESTORE_ACC:
1731 case PPC::RESTORE_UACC:
1741 case PPC::SPILL_WACC:
1744 case PPC::RESTORE_WACC:
1747 case PPC::SPILL_DMRP:
1748 case PPC::SPILL_DMR:
1751 case PPC::RESTORE_DMRP:
1752 case PPC::RESTORE_DMR:
1755 case PPC::SPILL_QUADWORD:
1758 case PPC::RESTORE_QUADWORD:
1764 MI.getOperand(FIOperandNum).ChangeToRegister(
1769 bool noImmForm = !
MI.isInlineAsm() && OpC != TargetOpcode::STACKMAP &&
1770 OpC != TargetOpcode::PATCHPOINT && !ImmToIdxMap.count(OpC);
1774 Offset +=
MI.getOperand(OffsetOperandNo).getImm();
1789 if ((OpC == PPC::LXVP || OpC == PPC::STXVP) &&
1791 Subtarget.hasPrefixInstrs() && Subtarget.hasP10Vector()) {
1792 unsigned NewOpc = OpC == PPC::LXVP ? PPC::PLXVP : PPC::PSTXVP;
1793 MI.setDesc(
TII.get(NewOpc));
1803 assert(OpC != PPC::DBG_VALUE &&
1804 "This should be handled in a target-independent way");
1807 bool OffsetFitsMnemonic = (OpC == PPC::EVSTDD || OpC == PPC::EVLDD) ?
1810 if (
TII.isPrefixed(
MI.getOpcode()))
1812 if (!noImmForm && ((OffsetFitsMnemonic &&
1814 OpC == TargetOpcode::STACKMAP ||
1815 OpC == TargetOpcode::PATCHPOINT)) {
1816 MI.getOperand(OffsetOperandNo).ChangeToImmediate(
Offset);
1827 unsigned NewOpcode = 0u;
1828 bool ScavengingFailed = RS && RS->getRegsAvailable(RC).none() &&
1829 RS->getRegsAvailable(&PPC::VSFRCRegClass).any();
1834 if (ScavengingFailed && Subtarget.hasDirectMove()) {
1837 SRegHi = SReg =
is64Bit ? PPC::X4 : PPC::R4;
1838 if (
MI.getOperand(0).getReg() == SReg)
1839 SRegHi = SReg = SReg + 1;
1867 unsigned OperandBase;
1871 else if (OpC != TargetOpcode::INLINEASM &&
1872 OpC != TargetOpcode::INLINEASM_BR) {
1873 assert(ImmToIdxMap.count(OpC) &&
1874 "No indexed form of load or store available!");
1875 NewOpcode = ImmToIdxMap.find(OpC)->second;
1876 MI.setDesc(
TII.get(NewOpcode));
1879 OperandBase = OffsetOperandNo;
1882 Register StackReg =
MI.getOperand(FIOperandNum).getReg();
1883 MI.getOperand(OperandBase).ChangeToRegister(StackReg,
false);
1884 MI.getOperand(OperandBase + 1).ChangeToRegister(SReg,
false,
false,
true);
1888 if (ScavengingFailed && Subtarget.hasDirectMove())
1895 if (NewOpcode == PPC::LQX_PSEUDO || NewOpcode == PPC::STQX_PSEUDO) {
1896 assert(
is64Bit &&
"Quadword loads/stores only supported in 64-bit mode");
1901 MI.setDesc(
TII.get(NewOpcode == PPC::LQX_PSEUDO ? PPC::LQ : PPC::STQ));
1902 MI.getOperand(OperandBase + 1).ChangeToRegister(NewReg,
false);
1903 MI.getOperand(OperandBase).ChangeToImmediate(0);
1912 return TFI->
hasFP(MF) ? PPC::R31 : PPC::R1;
1914 return TFI->
hasFP(MF) ? PPC::X31 : PPC::X1;
1925 if (Subtarget.
isSVR4ABI() && TM.isPositionIndependent())
1940 return hasStackRealignment(MF);
1960 unsigned OpC =
MI->getOpcode();
1961 if (!ImmToIdxMap.count(OpC))
1965 if ((OpC == PPC::ADDI || OpC == PPC::ADDI8) &&
1966 MI->getOperand(2).getImm() == 0)
1995 unsigned ADDriOpc = TM.isPPC64() ? PPC::ADDI8 : PPC::ADDI;
1999 if (Ins !=
MBB->end())
2000 DL = Ins->getDebugLoc();
2017 unsigned FIOperandNum = 0;
2018 while (!
MI.getOperand(FIOperandNum).isFI()) {
2020 assert(FIOperandNum <
MI.getNumOperands() &&
2021 "Instr doesn't have FrameIndex operand!");
2024 MI.getOperand(FIOperandNum).ChangeToRegister(BaseReg,
false);
2026 Offset +=
MI.getOperand(OffsetOperandNo).getImm();
2027 MI.getOperand(OffsetOperandNo).ChangeToImmediate(
Offset);
2041 unsigned FIOperandNum = 0;
2042 while (!
MI->getOperand(FIOperandNum).isFI()) {
2044 assert(FIOperandNum < MI->getNumOperands() &&
2045 "Instr doesn't have FrameIndex operand!");
2049 Offset +=
MI->getOperand(OffsetOperandNo).getImm();
2051 return MI->getOpcode() == PPC::DBG_VALUE ||
2052 MI->getOpcode() == TargetOpcode::STACKMAP ||
2053 MI->getOpcode() == TargetOpcode::PATCHPOINT ||
static const TargetRegisterClass * getRegClass(const MachineInstr &MI, Register Reg)
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
This file implements the BitVector class.
const HexagonInstrInfo * TII
static cl::opt< bool > EnableBasePointer("m68k-use-base-pointer", cl::Hidden, cl::init(true), cl::desc("Enable use of a base pointer for complex stack frames"))
Register const TargetRegisterInfo * TRI
uint64_t IntrinsicInst * II
cl::opt< bool > DisableAutoPairedVecSt("disable-auto-paired-vec-st", cl::desc("disable automatically generated 32byte paired vector stores"), cl::init(true), cl::Hidden)
static cl::opt< unsigned > MaxCRBitSpillDist("ppc-max-crbit-spill-dist", cl::desc("Maximum search distance for definition of CR bit " "spill on ppc"), cl::Hidden, cl::init(100))
static cl::opt< bool > EnableBasePointer("ppc-use-base-pointer", cl::Hidden, cl::init(true), cl::desc("Enable use of a base pointer for complex stack frames"))
static cl::opt< bool > EnableGPRToVecSpills("ppc-enable-gpr-to-vsr-spills", cl::Hidden, cl::init(false), cl::desc("Enable spills from gpr to vsr rather than stack"))
static cl::opt< bool > ReportAccMoves("ppc-report-acc-moves", cl::desc("Emit information about accumulator register spills " "and copies"), cl::Hidden, cl::init(false))
static void emitWAccSpillRestoreInfo(MachineBasicBlock &MBB, bool IsRestore)
static unsigned getOffsetONFromFION(const MachineInstr &MI, unsigned FIOperandNum)
static unsigned offsetMinAlignForOpcode(unsigned OpC)
static void emitAccSpillRestoreInfo(MachineBasicBlock &MBB, bool IsPrimed, bool IsRestore)
static unsigned offsetMinAlign(const MachineInstr &MI)
static cl::opt< bool > StackPtrConst("ppc-stack-ptr-caller-preserved", cl::desc("Consider R1 caller preserved so stack saves of " "caller preserved registers can be LICM candidates"), cl::init(true), cl::Hidden)
static cl::opt< bool > AlwaysBasePointer("ppc-always-use-base-pointer", cl::Hidden, cl::init(false), cl::desc("Force the use of a base pointer in every function"))
This file declares the machine register scavenger class.
This file defines the 'Statistic' class, which is designed to be an easy way to expose various metric...
#define STATISTIC(VARNAME, DESC)
static bool is64Bit(const char *name)
Represent a constant reference to an array (0 or more elements consecutively in memory),...
bool test(unsigned Idx) const
Returns true if bit Idx is set.
The CalleeSavedInfo class tracks the information need to locate where a callee saved register is in t...
CallingConv::ID getCallingConv() const
getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this functio...
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
Describe properties that are true of each instruction in the target description file.
MCRegAliasIterator enumerates all registers aliasing Reg.
ArrayRef< unsigned > superclasses() const
Returns a list of super-classes.
unsigned getID() const
getID() - Return the register class ID number.
bool contains(MCRegister Reg) const
contains - Return true if the specified register is included in this register class.
MCRegister getSubReg(MCRegister Reg, unsigned Idx) const
Returns the physical register number of sub-register "Index" for physical register RegNo.
Wrapper class representing physical registers. Should be passed by value.
constexpr bool isPhysical() const
Return true if the specified register number is in the physical register namespace.
MachineInstrBundleIterator< MachineInstr, true > reverse_iterator
MachineInstrBundleIterator< MachineInstr > iterator
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
uint64_t getStackSize() const
Return the number of bytes that must be allocated to hold all of the fixed size frame objects.
Align getMaxAlign() const
Return alignment of this function's frame.
uint64_t getMaxCallFrameSize() const
Return the maximum size of a call frame that must be allocated for an outgoing function call.
bool isCalleeSavedInfoValid() const
Has the callee saved info been calculated yet?
const std::vector< CalleeSavedInfo > & getCalleeSavedInfo() const
Returns a reference to call saved info vector for the current function.
int64_t getObjectOffset(int ObjectIdx) const
Return the assigned stack offset of the specified object from the incoming stack pointer.
bool isFixedObjectIndex(int ObjectIdx) const
Returns true if the specified index corresponds to a fixed stack object.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
bool hasInlineAsm() const
Returns true if the function contains any inline assembly.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
Function & getFunction()
Return the LLVM function that this machine code represents.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
const MachineInstrBuilder & addReg(Register RegNo, RegState Flags={}, unsigned SubReg=0) const
Add a new virtual register operand.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
const MachineInstrBuilder & addFrameIndex(int Idx) const
const MachineInstrBuilder & addDef(Register RegNo, RegState Flags={}, unsigned SubReg=0) const
Add a virtual register definition operand.
Representation of each machine instruction.
MachineOperand class - Representation of each machine instruction operand.
unsigned getSubReg() const
Register getReg() const
getReg - Returns the register number.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
const TargetRegisterClass * getRegClass(Register Reg) const
Return the register class of the specified virtual register.
LLVM_ABI Register createVirtualRegister(const TargetRegisterClass *RegClass, StringRef Name="")
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
bool isAllocatable(MCRegister PhysReg) const
isAllocatable - Returns true when PhysReg belongs to an allocatable register class and it hasn't been...
LLVM_ABI const TargetRegisterClass * constrainRegClass(Register Reg, const TargetRegisterClass *RC, unsigned MinNumRegs=0)
constrainRegClass - Constrain the register class of the specified virtual register to be a common sub...
iterator_range< reg_instr_nodbg_iterator > reg_nodbg_instructions(Register Reg) const
uint64_t determineFrameLayout(const MachineFunction &MF, bool UseEstimate=false, unsigned *NewMaxCallFrameSize=nullptr) const
Determine the frame layout but do not update the machine function.
PPCFunctionInfo - This class is derived from MachineFunction private PowerPC target-specific informat...
int getFramePointerSaveIndex() const
bool usesTOCBasePtr() const
void resolveFrameIndex(MachineInstr &MI, Register BaseReg, int64_t Offset) const override
bool getRegAllocationHints(Register VirtReg, ArrayRef< MCPhysReg > Order, SmallVectorImpl< MCPhysReg > &Hints, const MachineFunction &MF, const VirtRegMap *VRM, const LiveRegMatrix *Matrix) const override
Register getFrameRegister(const MachineFunction &MF) const override
bool hasBasePointer(const MachineFunction &MF) const
Register getBaseRegister(const MachineFunction &MF) const
void lowerDMRRestore(MachineBasicBlock::iterator II, unsigned FrameIndex) const
lowerDMRRestore - Generate the code to restore the DMR register.
void prepareDynamicAlloca(MachineBasicBlock::iterator II, Register &NegSizeReg, bool &KillNegSizeReg, Register &FramePointer) const
To accomplish dynamic stack allocation, we have to calculate exact size subtracted from the stack poi...
void lowerCRBitSpilling(MachineBasicBlock::iterator II, unsigned FrameIndex) const
void lowerACCSpilling(MachineBasicBlock::iterator II, unsigned FrameIndex) const
lowerACCSpilling - Generate the code for spilling the accumulator register.
bool requiresFrameIndexScavenging(const MachineFunction &MF) const override
void lowerCRSpilling(MachineBasicBlock::iterator II, unsigned FrameIndex) const
lowerCRSpilling - Generate the code for spilling a CR register.
void lowerDynamicAreaOffset(MachineBasicBlock::iterator II) const
void lowerDynamicAlloc(MachineBasicBlock::iterator II) const
lowerDynamicAlloc - Generate the code for allocating an object in the current frame.
const uint32_t * getCallPreservedMask(const MachineFunction &MF, CallingConv::ID CC) const override
void adjustStackMapLiveOutMask(uint32_t *Mask) const override
bool hasReservedSpillSlot(const MachineFunction &MF, Register Reg, int &FrameIdx) const override
bool isCallerPreservedPhysReg(MCRegister PhysReg, const MachineFunction &MF) const override
bool needsFrameBaseReg(MachineInstr *MI, int64_t Offset) const override
Returns true if the instruction's frame index reference would be better served by a base register oth...
const TargetRegisterClass * getCrossCopyRegClass(const TargetRegisterClass *RC) const override
const uint32_t * getNoPreservedMask() const override
void lowerDMRSpilling(MachineBasicBlock::iterator II, unsigned FrameIndex) const
lowerDMRSpilling - Generate the code for spilling the DMR register.
void lowerCRRestore(MachineBasicBlock::iterator II, unsigned FrameIndex) const
bool eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj, unsigned FIOperandNum, RegScavenger *RS=nullptr) const override
void lowerQuadwordRestore(MachineBasicBlock::iterator II, unsigned FrameIndex) const
lowerQuadwordRestore - Generate code to restore paired general register.
static void emitAccCopyInfo(MachineBasicBlock &MBB, MCRegister DestReg, MCRegister SrcReg)
bool requiresVirtualBaseRegisters(const MachineFunction &MF) const override
void lowerCRBitRestore(MachineBasicBlock::iterator II, unsigned FrameIndex) const
const MCPhysReg * getCalleeSavedRegs(const MachineFunction *MF) const override
Code Generation virtual methods...
Register materializeFrameBaseRegister(MachineBasicBlock *MBB, int FrameIdx, int64_t Offset) const override
Insert defining instruction(s) for BaseReg to be a pointer to FrameIdx at the beginning of the basic ...
unsigned getRegPressureLimit(const TargetRegisterClass *RC, MachineFunction &MF) const override
void lowerWACCRestore(MachineBasicBlock::iterator II, unsigned FrameIndex) const
lowerWACCRestore - Generate the code to restore the wide accumulator register.
void lowerPrepareProbedAlloca(MachineBasicBlock::iterator II) const
void lowerQuadwordSpilling(MachineBasicBlock::iterator II, unsigned FrameIndex) const
lowerQuadwordSpilling - Generate code to spill paired general register.
PPCRegisterInfo(const PPCTargetMachine &TM)
bool isFrameOffsetLegal(const MachineInstr *MI, Register BaseReg, int64_t Offset) const override
void lowerWACCSpilling(MachineBasicBlock::iterator II, unsigned FrameIndex) const
lowerWACCSpilling - Generate the code for spilling the wide accumulator register.
void lowerOctWordSpilling(MachineBasicBlock::iterator II, unsigned FrameIndex) const
Remove any STXVP[X] instructions and split them out into a pair of STXV[X] instructions if –disable-a...
bool isAsmClobberable(const MachineFunction &MF, MCRegister PhysReg) const override
BitVector getReservedRegs(const MachineFunction &MF) const override
const TargetRegisterClass * getLargestLegalSuperClass(const TargetRegisterClass *RC, const MachineFunction &MF) const override
void lowerACCRestore(MachineBasicBlock::iterator II, unsigned FrameIndex) const
lowerACCRestore - Generate the code to restore the accumulator register.
bool is32BitELFABI() const
bool isUsingPCRelativeCalls() const
const PPCInstrInfo * getInstrInfo() const override
bool isAIXExtendedAltivecABI() const
Returns true when the AIX extended Altivec ABI ("vec-extabi") is in effect, allowing use of the nonvo...
bool isLittleEndian() const
MCRegister getTOCPointerRegister() const
MCRegister getStackPointerRegister() const
bool is64BitELFABI() const
const PPCRegisterInfo * getRegisterInfo() const override
Common code between 32-bit and 64-bit PowerPC targets.
Wrapper class representing virtual and physical registers.
constexpr bool isVirtual() const
Return true if the specified register number is in the virtual register namespace.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
bool hasFP(const MachineFunction &MF) const
hasFP - Return true if the specified function should have a dedicated frame pointer register.
Align getStackAlign() const
getStackAlignment - This method returns the number of bytes to which the stack pointer must be aligne...
TargetInstrInfo - Interface to description of machine instruction set.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
virtual const TargetRegisterClass * getLargestLegalSuperClass(const TargetRegisterClass *RC, const MachineFunction &) const
Returns the largest super class of RC that is legal to use in the current sub-target and has the same...
virtual bool getRegAllocationHints(Register VirtReg, ArrayRef< MCPhysReg > Order, SmallVectorImpl< MCPhysReg > &Hints, const MachineFunction &MF, const VirtRegMap *VRM=nullptr, const LiveRegMatrix *Matrix=nullptr) const
Get a list of 'hint' registers that the register allocator should try first when allocating a physica...
A Use represents the edge between a Value definition and its users.
MCRegister getPhys(Register virtReg) const
returns the physical register mapped to the specified virtual register
bool hasPhys(Register virtReg) const
returns true if the specified virtual register is mapped to a physical register
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
@ AnyReg
OBSOLETED - Used for stack based JavaScript calls.
@ Cold
Attempts to make code in the caller as efficient as possible under the assumption that the call is no...
Define some predicates that are used for node matching.
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
constexpr bool isInt(int64_t x)
Checks if an integer fits into the given bit width.
@ Implicit
Not emitted register (e.g. carry, or temporary result).
@ Kill
The last use of a register.
@ Undef
Value of the register doesn't matter.
constexpr RegState getKillRegState(bool B)
bool isAligned(Align Lhs, uint64_t SizeInBytes)
Checks that SizeInBytes is a multiple of the alignment.
static const MachineInstrBuilder & addFrameReference(const MachineInstrBuilder &MIB, int FI, int Offset=0, bool mem=true)
addFrameReference - This function is used to add a reference to the base of an abstract object on the...
static unsigned getCRFromCRBit(unsigned SrcReg)
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
constexpr bool isUInt(uint64_t x)
Checks if an unsigned integer fits into the given bit width.
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
LLVM_ABI Printable printReg(Register Reg, const TargetRegisterInfo *TRI=nullptr, unsigned SubIdx=0, const MachineRegisterInfo *MRI=nullptr)
Prints virtual and physical registers with or without a TRI instance.
MCRegisterClass TargetRegisterClass
This struct is a compact representation of a valid (non-zero power of two) alignment.
constexpr uint64_t value() const
This is a hole in the type system and should not be abused.