48 #define DEBUG_TYPE "reginfo" 50 #define GET_REGINFO_TARGET_DESC 51 #include "PPCGenRegisterInfo.inc" 53 STATISTIC(InflateGPRC,
"Number of gprc inputs for getLargestLegalClass");
54 STATISTIC(InflateGP8RC,
"Number of g8rc inputs for getLargestLegalClass");
58 cl::desc(
"Enable use of a base pointer for complex stack frames"));
62 cl::desc(
"Force the use of a base pointer in every function"));
66 cl::desc(
"Enable spills from gpr to vsr rather than stack"));
70 cl::desc(
"Consider R1 caller preserved so stack saves of " 71 "caller preserved registers can be LICM candidates"),
77 TM.isPPC64() ? 0 : 1),
79 ImmToIdxMap[
PPC::LD] = PPC::LDX; ImmToIdxMap[PPC::STD] = PPC::STDX;
80 ImmToIdxMap[PPC::LBZ] = PPC::LBZX; ImmToIdxMap[PPC::STB] = PPC::STBX;
81 ImmToIdxMap[PPC::LHZ] = PPC::LHZX; ImmToIdxMap[PPC::LHA] = PPC::LHAX;
82 ImmToIdxMap[PPC::LWZ] = PPC::LWZX; ImmToIdxMap[PPC::LWA] = PPC::LWAX;
83 ImmToIdxMap[PPC::LFS] = PPC::LFSX; ImmToIdxMap[PPC::LFD] = PPC::LFDX;
84 ImmToIdxMap[PPC::STH] = PPC::STHX; ImmToIdxMap[PPC::STW] = PPC::STWX;
85 ImmToIdxMap[PPC::STFS] = PPC::STFSX; ImmToIdxMap[PPC::STFD] = PPC::STFDX;
86 ImmToIdxMap[PPC::ADDI] = PPC::ADD4;
87 ImmToIdxMap[PPC::LWA_32] = PPC::LWAX_32;
90 ImmToIdxMap[PPC::LHA8] = PPC::LHAX8; ImmToIdxMap[PPC::LBZ8] = PPC::LBZX8;
91 ImmToIdxMap[PPC::LHZ8] = PPC::LHZX8; ImmToIdxMap[PPC::LWZ8] = PPC::LWZX8;
92 ImmToIdxMap[PPC::STB8] = PPC::STBX8; ImmToIdxMap[PPC::STH8] = PPC::STHX8;
93 ImmToIdxMap[PPC::STW8] = PPC::STWX8; ImmToIdxMap[PPC::STDU] = PPC::STDUX;
94 ImmToIdxMap[PPC::ADDI8] = PPC::ADD8;
97 ImmToIdxMap[PPC::DFLOADf32] = PPC::LXSSPX;
98 ImmToIdxMap[PPC::DFLOADf64] = PPC::LXSDX;
99 ImmToIdxMap[PPC::SPILLTOVSR_LD] = PPC::SPILLTOVSR_LDX;
100 ImmToIdxMap[PPC::SPILLTOVSR_ST] = PPC::SPILLTOVSR_STX;
101 ImmToIdxMap[PPC::DFSTOREf32] = PPC::STXSSPX;
102 ImmToIdxMap[PPC::DFSTOREf64] = PPC::STXSDX;
103 ImmToIdxMap[PPC::LXV] = PPC::LXVX;
104 ImmToIdxMap[PPC::LXSD] = PPC::LXSDX;
105 ImmToIdxMap[PPC::LXSSP] = PPC::LXSSPX;
106 ImmToIdxMap[PPC::STXV] = PPC::STXVX;
107 ImmToIdxMap[PPC::STXSD] = PPC::STXSDX;
108 ImmToIdxMap[PPC::STXSSP] = PPC::STXSSPX;
111 ImmToIdxMap[PPC::EVLDD] = PPC::EVLDDX;
112 ImmToIdxMap[PPC::EVSTDD] = PPC::EVSTDDX;
113 ImmToIdxMap[PPC::SPESTW] = PPC::SPESTWX;
114 ImmToIdxMap[PPC::SPELWZ] = PPC::SPELWZX;
126 return &PPC::G8RC_NOX0RegClass;
127 return &PPC::GPRC_NOR0RegClass;
131 return &PPC::G8RCRegClass;
132 return &PPC::GPRCRegClass;
140 return CSR_64_AllRegs_VSX_SaveList;
142 return CSR_64_AllRegs_Altivec_SaveList;
143 return CSR_64_AllRegs_SaveList;
148 ? (Subtarget.
hasAltivec() ? CSR_Darwin64_Altivec_SaveList
149 : CSR_Darwin64_SaveList)
150 : (Subtarget.
hasAltivec() ? CSR_Darwin32_Altivec_SaveList
151 : CSR_Darwin32_SaveList);
154 return CSR_SRV464_TLS_PE_SaveList;
157 return CSR_SVR432_SPE_SaveList;
165 ? (SaveR2 ? CSR_SVR64_ColdCC_R2_Altivec_SaveList
166 : CSR_SVR64_ColdCC_Altivec_SaveList)
167 : (SaveR2 ? CSR_SVR64_ColdCC_R2_SaveList
168 : CSR_SVR64_ColdCC_SaveList))
169 : (Subtarget.
hasAltivec() ? CSR_SVR32_ColdCC_Altivec_SaveList
170 : CSR_SVR32_ColdCC_SaveList);
175 ? (SaveR2 ? CSR_SVR464_R2_Altivec_SaveList
176 : CSR_SVR464_Altivec_SaveList)
177 : (SaveR2 ? CSR_SVR464_R2_SaveList : CSR_SVR464_SaveList))
178 : (Subtarget.
hasAltivec() ? CSR_SVR432_Altivec_SaveList
179 : CSR_SVR432_SaveList);
184 assert(MF &&
"Invalid MachineFunction pointer.");
199 ? CSR_SVR464_R2_Altivec_ViaCopy_SaveList
200 : CSR_SVR464_Altivec_ViaCopy_SaveList;
203 ? CSR_SVR464_R2_ViaCopy_SaveList
204 : CSR_SVR464_ViaCopy_SaveList;
213 return CSR_64_AllRegs_VSX_RegMask;
215 return CSR_64_AllRegs_Altivec_RegMask;
216 return CSR_64_AllRegs_RegMask;
221 : CSR_Darwin64_RegMask)
222 : (Subtarget.
hasAltivec() ? CSR_Darwin32_Altivec_RegMask
223 : CSR_Darwin32_RegMask);
227 : CSR_SVR64_ColdCC_RegMask)
228 : (Subtarget.
hasAltivec() ? CSR_SVR32_ColdCC_Altivec_RegMask
229 : CSR_SVR32_ColdCC_RegMask);
233 : CSR_SVR464_RegMask)
234 : (Subtarget.
hasAltivec() ? CSR_SVR432_Altivec_RegMask
235 : CSR_SVR432_RegMask);
240 return CSR_NoRegs_RegMask;
244 for (
unsigned PseudoReg : {PPC::ZERO, PPC::ZERO8,
PPC::RM})
245 Mask[PseudoReg / 32] &= ~(1u << (PseudoReg % 32));
255 markSuperRegs(Reserved, PPC::ZERO);
259 markSuperRegs(Reserved,
PPC::FP);
263 markSuperRegs(Reserved, PPC::BP);
267 markSuperRegs(Reserved, PPC::CTR);
268 markSuperRegs(Reserved, PPC::CTR8);
270 markSuperRegs(Reserved, PPC::R1);
271 markSuperRegs(Reserved, PPC::LR);
272 markSuperRegs(Reserved, PPC::LR8);
273 markSuperRegs(Reserved,
PPC::RM);
276 markSuperRegs(Reserved, PPC::VRSAVE);
287 markSuperRegs(Reserved,
PPC::R2);
288 markSuperRegs(Reserved, PPC::R13);
293 markSuperRegs(Reserved, PPC::R13);
295 if (TFI->needsFP(MF))
296 markSuperRegs(Reserved, PPC::R31);
301 markSuperRegs(Reserved, PPC::R29);
303 markSuperRegs(Reserved, PPC::R30);
307 markSuperRegs(Reserved, PPC::R30);
312 IE = PPC::VRRCRegClass.end();
I !=
IE; ++
I)
313 markSuperRegs(Reserved, *
I);
315 assert(checkAllSuperRegsMarked(Reserved));
329 if (PhysReg == PPC::X2)
335 if (
StackPtrConst && (PhysReg == PPC::X1) && !MFI.hasVarSizedObjects()
336 && !MFI.hasOpaqueSPAdjustment())
347 const unsigned DefaultSafety = 1;
349 switch (RC->
getID()) {
352 case PPC::G8RC_NOX0RegClassID:
353 case PPC::GPRC_NOR0RegClassID:
354 case PPC::SPERCRegClassID:
355 case PPC::SPE4RCRegClassID:
356 case PPC::G8RCRegClassID:
357 case PPC::GPRCRegClassID: {
358 unsigned FP = TFI->
hasFP(MF) ? 1 : 0;
359 return 32 - FP - DefaultSafety;
361 case PPC::F8RCRegClassID:
362 case PPC::F4RCRegClassID:
363 case PPC::QFRCRegClassID:
364 case PPC::QSRCRegClassID:
365 case PPC::QBRCRegClassID:
366 case PPC::VRRCRegClassID:
367 case PPC::VFRCRegClassID:
368 case PPC::VSLRCRegClassID:
369 return 32 - DefaultSafety;
370 case PPC::VSRCRegClassID:
371 case PPC::VSFRCRegClassID:
372 case PPC::VSSRCRegClassID:
373 return 64 - DefaultSafety;
374 case PPC::CRRCRegClassID:
375 return 8 - DefaultSafety;
392 RC == &PPC::G8RCRegClass) {
394 return &PPC::SPILLTOVSRRCRegClass;
399 if (RC == &PPC::F8RCRegClass)
400 return &PPC::VSFRCRegClass;
401 else if (RC == &PPC::VRRCRegClass)
402 return &PPC::VSRCRegClass;
403 else if (RC == &PPC::F4RCRegClass && Subtarget.
hasP8Vector())
404 return &PPC::VSSRCRegClass;
446 assert((maxCallFrameSize & (MaxAlign-1)) == 0 &&
447 "Maximum call-frame size not sufficiently aligned");
459 if (MaxAlign < TargetAlign &&
isInt<16>(FrameSize)) {
484 if (MaxAlign > TargetAlign) {
485 unsigned UnalNegSizeReg = NegSizeReg;
490 BuildMI(MBB, II, dl, TII.
get(PPC::LI8), NegSizeReg)
491 .addImm(~(MaxAlign-1));
493 unsigned NegSizeReg1 = NegSizeReg;
495 BuildMI(MBB, II, dl, TII.
get(PPC::AND8), NegSizeReg)
498 KillNegSizeReg =
true;
501 BuildMI(MBB, II, dl, TII.
get(PPC::STDUX), PPC::X1)
507 .
addImm(maxCallFrameSize);
509 if (MaxAlign > TargetAlign) {
510 unsigned UnalNegSizeReg = NegSizeReg;
515 BuildMI(MBB, II, dl, TII.
get(PPC::LI), NegSizeReg)
516 .addImm(~(MaxAlign-1));
518 unsigned NegSizeReg1 = NegSizeReg;
523 KillNegSizeReg =
true;
526 BuildMI(MBB, II, dl, TII.
get(PPC::STWUX), PPC::R1)
532 .
addImm(maxCallFrameSize);
556 BuildMI(MBB, II, dl, TII.
get(is64Bit ? PPC::LI8 : PPC::LI),
558 .addImm(maxCallFrameSize);
595 if (SrcReg != PPC::CR0) {
600 BuildMI(MBB, II, dl, TII.
get(LP64 ? PPC::RLWINM8 : PPC::RLWINM),
Reg)
602 .
addImm(getEncodingValue(SrcReg) * 4)
633 "RESTORE_CR does not define its destination");
640 if (DestReg != PPC::CR0) {
644 unsigned ShiftBits = getEncodingValue(DestReg)*4;
646 BuildMI(MBB, II, dl, TII.
get(LP64 ? PPC::RLWINM8 : PPC::RLWINM),
Reg)
651 BuildMI(MBB, II, dl, TII.
get(LP64 ? PPC::MTOCRF8 : PPC::MTOCRF), DestReg)
692 BuildMI(MBB, II, dl, TII.
get(LP64 ? PPC::RLWINM8 : PPC::RLWINM),
Reg)
694 .
addImm(getEncodingValue(SrcReg))
723 "RESTORE_CRBIT does not define its destination");
728 BuildMI(MBB, II, dl, TII.
get(TargetOpcode::IMPLICIT_DEF), DestReg);
734 unsigned ShiftBits = getEncodingValue(DestReg);
736 BuildMI(MBB, II, dl, TII.
get(LP64 ? PPC::RLWIMI8 : PPC::RLWIMI), RegO)
739 .
addImm(ShiftBits ? 32 - ShiftBits : 0)
743 BuildMI(MBB, II, dl, TII.
get(LP64 ? PPC::MTOCRF8 : PPC::MTOCRF),
796 "RESTORE_VRSAVE does not define its destination");
801 BuildMI(MBB, II, dl, TII.
get(PPC::MTVRSAVEv), DestReg)
809 unsigned Reg,
int &FrameIdx)
const {
816 if (Subtarget.
isSVR4ABI() && PPC::CR2 <= Reg && Reg <= PPC::CR4) {
843 case PPC::DFSTOREf32:
844 case PPC::DFSTOREf64:
858 unsigned FIOperandNum) {
860 unsigned OffsetOperandNo = (FIOperandNum == 2) ? 1 : 2;
862 OffsetOperandNo = FIOperandNum - 1;
863 else if (MI.
getOpcode() == TargetOpcode::STACKMAP ||
864 MI.
getOpcode() == TargetOpcode::PATCHPOINT)
865 OffsetOperandNo = FIOperandNum + 1;
867 return OffsetOperandNo;
872 int SPAdj,
unsigned FIOperandNum,
874 assert(SPAdj == 0 &&
"Unexpected");
907 if (FPSI && FrameIndex == FPSI &&
914 if (OpC == PPC::SPILL_CR) {
917 }
else if (OpC == PPC::RESTORE_CR) {
920 }
else if (OpC == PPC::SPILL_CRBIT) {
923 }
else if (OpC == PPC::RESTORE_CRBIT) {
926 }
else if (OpC == PPC::SPILL_VRSAVE) {
929 }
else if (OpC == PPC::RESTORE_VRSAVE) {
940 bool noImmForm = !MI.
isInlineAsm() && OpC != TargetOpcode::STACKMAP &&
941 OpC != TargetOpcode::PATCHPOINT && !ImmToIdxMap.
count(OpC);
964 assert(OpC != PPC::DBG_VALUE &&
965 "This should be handled in a target-independent way");
968 OpC == TargetOpcode::STACKMAP ||
969 OpC == TargetOpcode::PATCHPOINT)) {
986 BuildMI(MBB, II, dl, TII.
get(is64Bit ? PPC::LI8 : PPC::LI), SReg)
989 BuildMI(MBB, II, dl, TII.
get(is64Bit ? PPC::LIS8 : PPC::LIS), SRegHi)
990 .addImm(Offset >> 16);
991 BuildMI(MBB, II, dl, TII.
get(is64Bit ? PPC::ORI8 : PPC::ORI), SReg)
1000 unsigned OperandBase;
1006 "No indexed form of load or store available!");
1007 unsigned NewOpcode = ImmToIdxMap.
find(OpC)->second;
1008 MI.
setDesc(TII.get(NewOpcode));
1011 OperandBase = OffsetOperandNo;
1023 return TFI->
hasFP(MF) ? PPC::R31 : PPC::R1;
1025 return TFI->
hasFP(MF) ? PPC::X31 : PPC::X1;
1051 return needsStackRealignment(MF);
1060 assert(Offset < 0 &&
"Local offset must be negative");
1072 if (!ImmToIdxMap.
count(OpC))
1076 if ((OpC == PPC::ADDI || OpC == PPC::ADDI8) &&
1105 unsigned BaseReg,
int FrameIdx,
1107 unsigned ADDriOpc = TM.
isPPC64() ? PPC::ADDI8 : PPC::ADDI;
1111 if (Ins != MBB->
end())
1112 DL = Ins->getDebugLoc();
1121 BuildMI(*MBB, Ins, DL, MCID, BaseReg)
1127 unsigned FIOperandNum = 0;
1131 "Instr doesn't have FrameIndex operand!");
1146 TII.getRegClass(MCID, FIOperandNum,
this, MF));
1152 unsigned FIOperandNum = 0;
1155 assert(FIOperandNum < MI->getNumOperands() &&
1156 "Instr doesn't have FrameIndex operand!");
1162 return MI->
getOpcode() == PPC::DBG_VALUE ||
1163 MI->
getOpcode() == TargetOpcode::STACKMAP ||
1164 MI->
getOpcode() == TargetOpcode::PATCHPOINT ||
const uint32_t * getCallPreservedMask(const MachineFunction &MF, CallingConv::ID CC) const override
BitVector getReservedRegs(const MachineFunction &MF) const override
DILocation * get() const
Get the underlying DILocation.
bool isFrameOffsetLegal(const MachineInstr *MI, unsigned BaseReg, int64_t Offset) const override
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
int getFramePointerSaveIndex() const
bool isAllocatable(unsigned PhysReg) const
isAllocatable - Returns true when PhysReg belongs to an allocatable register class and it hasn't been...
This class represents lattice values for constants.
void ChangeToRegister(unsigned Reg, bool isDef, bool isImp=false, bool isKill=false, bool isDead=false, bool isUndef=false, bool isDebug=false)
ChangeToRegister - Replace this operand with a new register operand of the specified value...
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 DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
Describe properties that are true of each instruction in the target description file.
unsigned getReg() const
getReg - Returns the register number.
The following two target-specific nodes are used for calls through function pointers in the 64-bit SV...
const TargetRegisterClass * getLargestLegalSuperClass(const TargetRegisterClass *RC, const MachineFunction &MF) const override
bool test(unsigned Idx) const
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
void lowerCRBitRestore(MachineBasicBlock::iterator II, unsigned FrameIndex) const
constexpr bool isInt< 16 >(int64_t x)
STATISTIC(NumFunctions, "Total number of functions")
void lowerDynamicAreaOffset(MachineBasicBlock::iterator II) const
void lowerCRSpilling(MachineBasicBlock::iterator II, unsigned FrameIndex) const
lowerCRSpilling - Generate the code for spilling a CR register.
void eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj, unsigned FIOperandNum, RegScavenger *RS=nullptr) const override
instr_iterator erase(instr_iterator I)
Remove an instruction from the instruction list and delete it.
PPCFunctionInfo - This class is derived from MachineFunction private PowerPC target-specific informat...
int getCRSpillFrameIndex() const
const HexagonInstrInfo * TII
unsigned getNumOperands() const
Retuns the total number of operands.
static unsigned getOffsetONFromFION(const MachineInstr &MI, unsigned FIOperandNum)
int64_t getObjectOffset(int ObjectIdx) const
Return the assigned stack offset of the specified object from the incoming stack pointer.
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
void lowerCRRestore(MachineBasicBlock::iterator II, unsigned FrameIndex) const
bool hasFP(const MachineFunction &MF) const override
hasFP - Return true if the specified function should have a dedicated frame pointer register...
bool isCallerPreservedPhysReg(unsigned PhysReg, const MachineFunction &MF) const override
unsigned getID() const
Return the register class ID number.
INLINEASM - Represents an inline asm block.
const MCInstrDesc & getDesc() const
Returns the target instruction descriptor of this MachineInstr.
unsigned getFrameRegister(const MachineFunction &MF) const override
R32 = MFOCRF(CRREG, INFLAG) - Represents the MFOCRF instruction.
void lowerVRSAVESpilling(MachineBasicBlock::iterator II, unsigned FrameIndex) const
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...
bool hasBasePointer(const MachineFunction &MF) const
void adjustStackMapLiveOutMask(uint32_t *Mask) const override
const TargetRegisterClass * constrainRegClass(unsigned Reg, const TargetRegisterClass *RC, unsigned MinNumRegs=0)
constrainRegClass - Constrain the register class of the specified virtual register to be a common sub...
This instruction is lowered in PPCRegisterInfo::eliminateFrameIndex to compute an offset from native ...
unsigned getKillRegState(bool B)
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
void ChangeToImmediate(int64_t ImmVal)
ChangeToImmediate - Replace this operand with a new immediate operand of the specified value...
TargetInstrInfo - Interface to description of machine instruction set.
const MCPhysReg * getCalleeSavedRegs(const MachineFunction *MF) const override
Code Generation virtual methods...
iterator find(const_arg_type_t< KeyT > Val)
void materializeFrameBaseRegister(MachineBasicBlock *MBB, unsigned BaseReg, 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 ...
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
unsigned getBaseRegister(const MachineFunction &MF) const
initializer< Ty > init(const Ty &Val)
This file declares the machine register scavenger class.
void lowerVRSAVERestore(MachineBasicBlock::iterator II, unsigned FrameIndex) const
unsigned const MachineRegisterInfo * MRI
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
static bool is64Bit(const char *name)
This file contains the declarations for the subclasses of Constant, which represent the different fla...
static unsigned offsetMinAlign(const MachineInstr &MI)
unsigned getMaxAlignment() const
Return the alignment in bytes that this function must be aligned to, which is greater than the defaul...
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
bool definesRegister(unsigned Reg, const TargetRegisterInfo *TRI=nullptr) const
Return true if the MachineInstr fully defines the specified register.
Common code between 32-bit and 64-bit PowerPC targets.
const MachineInstrBuilder & addFrameIndex(int Idx) const
void resolveFrameIndex(MachineInstr &MI, unsigned BaseReg, int64_t Offset) const override
PPCRegisterInfo(const PPCTargetMachine &TM)
static unsigned getCRFromCRBit(unsigned SrcReg)
unsigned getStackAlignment() const
getStackAlignment - This method returns the number of bytes to which the stack pointer must be aligne...
const uint32_t * getNoPreservedMask() const override
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...
const MCPhysReg * getCalleeSavedRegsViaCopy(const MachineFunction *MF) const
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"))
void setDesc(const MCInstrDesc &tid)
Replace the instruction descriptor (thus opcode) of the current instruction with a new one...
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"))
unsigned getRegPressureLimit(const TargetRegisterClass *RC, MachineFunction &MF) const override
unsigned getMaxCallFrameSize() const
Return the maximum size of a call frame that must be allocated for an outgoing function call...
CallingConv::ID getCallingConv() const
getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this functio...
const PPCInstrInfo * getInstrInfo() const override
const Function & getFunction() const
Return the LLVM function that this machine code represents.
void lowerCRBitSpilling(MachineBasicBlock::iterator II, unsigned FrameIndex) const
const MCPhysReg * iterator
const MachineBasicBlock * getParent() const
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
Representation of each machine instruction.
static bool isPhysicalRegister(unsigned Reg)
Return true if the specified register number is in the physical register namespace.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
bool usesTOCBasePtr() const
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
Bitwise operators - logical and, logical or, logical xor.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
bool isPositionIndependent() const
const TargetRegisterClass * getPointerRegClass(const MachineFunction &MF, unsigned Kind=0) const override
getPointerRegClass - Return the register class to use to hold pointers.
bool hasInlineAsm() const
Returns true if the function contains any inline assembly.
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)
bool isFI() const
isFI - Tests if this is a MO_FrameIndex operand.
const MachineInstrBuilder & addReg(unsigned RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
size_type count(const_arg_type_t< KeyT > Val) const
Return 1 if the specified key is in the map, 0 otherwise.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void lowerDynamicAlloc(MachineBasicBlock::iterator II) const
lowerDynamicAlloc - Generate the code for allocating an object in the current frame.
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"))
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
unsigned determineFrameLayout(MachineFunction &MF, bool UpdateMF=true, bool UseEstimate=false) const
determineFrameLayout - Determine the size of the frame and maximum call frame size.
const MachineOperand & getOperand(unsigned i) const
uint64_t getStackSize() const
Return the number of bytes that must be allocated to hold all of the fixed size frame objects...
unsigned createVirtualRegister(const TargetRegisterClass *RegClass, StringRef Name="")
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
bool hasReservedSpillSlot(const MachineFunction &MF, unsigned Reg, int &FrameIdx) const override