LLVM
8.0.1
|
#include "Target/PowerPC/PPCRegisterInfo.h"
Static Public Member Functions | |
static const char * | stripRegisterPrefix (const char *RegName) |
stripRegisterPrefix - This method strips the character prefix from a register name so that only the number is left. More... | |
Definition at line 57 of file PPCRegisterInfo.h.
PPCRegisterInfo::PPCRegisterInfo | ( | const PPCTargetMachine & | TM | ) |
Definition at line 74 of file PPCRegisterInfo.cpp.
References llvm::ARM_MB::LD.
|
override |
Definition at line 243 of file PPCRegisterInfo.cpp.
References llvm::NVPTX::PTXCvtMode::RM.
|
override |
Definition at line 871 of file PPCRegisterInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), assert(), llvm::BuildMI(), llvm::MachineOperand::ChangeToImmediate(), llvm::MachineOperand::ChangeToRegister(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::count(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::PPCISD::DYNALLOC, llvm::PPCISD::DYNAREAOFFSET, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::ISD::FrameIndex, llvm::DebugLoc::get(), getBaseRegister(), llvm::MachineInstr::getDebugLoc(), llvm::MachineFunction::getFrameInfo(), llvm::PPCFunctionInfo::getFramePointerSaveIndex(), getFrameRegister(), llvm::MachineFunction::getFunction(), llvm::MachineOperand::getImm(), llvm::MachineOperand::getIndex(), llvm::MachineFunction::getInfo(), llvm::PPCSubtarget::getInstrInfo(), llvm::MachineFrameInfo::getObjectOffset(), getOffsetONFromFION(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::MachineFrameInfo::getStackSize(), llvm::MachineFunction::getSubtarget(), hasBasePointer(), llvm::Function::hasFnAttribute(), llvm::ISD::INLINEASM, is64Bit(), llvm::MachineInstr::isInlineAsm(), llvm::isInt< 16 >(), llvm::PPCTargetMachine::isPPC64(), llvm::RegState::Kill, lowerCRBitRestore(), lowerCRBitSpilling(), lowerCRRestore(), lowerCRSpilling(), lowerDynamicAlloc(), lowerDynamicAreaOffset(), lowerVRSAVERestore(), lowerVRSAVESpilling(), MI, llvm::Attribute::Naked, offsetMinAlign(), llvm::MachineInstr::setDesc(), and TII.
Referenced by requiresVirtualBaseRegisters().
unsigned PPCRegisterInfo::getBaseRegister | ( | const MachineFunction & | MF | ) | const |
Definition at line 1028 of file PPCRegisterInfo.cpp.
References getFrameRegister(), llvm::MachineFunction::getSubtarget(), hasBasePointer(), llvm::TargetMachine::isPositionIndependent(), llvm::PPCTargetMachine::isPPC64(), and llvm::PPCSubtarget::isSVR4ABI().
Referenced by llvm::PPCFrameLowering::determineCalleeSaves(), eliminateFrameIndex(), llvm::PPCFrameLowering::emitEpilogue(), llvm::PPCFrameLowering::emitPrologue(), needsFrameBaseReg(), llvm::PPCFrameLowering::processFunctionBeforeFrameFinalized(), llvm::PPCFrameLowering::replaceFPWithRealFP(), and requiresVirtualBaseRegisters().
|
override |
Code Generation virtual methods...
Definition at line 136 of file PPCRegisterInfo.cpp.
References llvm::CallingConv::AnyReg, llvm::CallingConv::Cold, llvm::Function::getCallingConv(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getInfo(), llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), llvm::PPCSubtarget::hasAltivec(), llvm::PPCSubtarget::hasSPE(), llvm::PPCSubtarget::hasVSX(), llvm::MachineRegisterInfo::isAllocatable(), llvm::PPCSubtarget::isDarwinABI(), and llvm::PPCTargetMachine::isPPC64().
Referenced by llvm::PPCFrameLowering::assignCalleeSavedSpillSlots(), and llvm::PPCFrameLowering::replaceFPWithRealFP().
const MCPhysReg * PPCRegisterInfo::getCalleeSavedRegsViaCopy | ( | const MachineFunction * | MF | ) | const |
Definition at line 183 of file PPCRegisterInfo.cpp.
References assert(), llvm::CallingConv::CXX_FAST_TLS, llvm::Function::getCallingConv(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getInfo(), getReservedRegs(), llvm::MachineFunction::getSubtarget(), llvm::PPCSubtarget::hasAltivec(), llvm::PPCSubtarget::isDarwinABI(), llvm::PPCTargetMachine::isPPC64(), llvm::PPCFunctionInfo::isSplitCSR(), and llvm::BitVector::test().
Referenced by llvm::PPCTargetLowering::insertCopiesSplitCSR(), and PrepareCall().
|
override |
|
override |
Definition at line 1019 of file PPCRegisterInfo.cpp.
References llvm::PPCFrameLowering::hasFP(), and llvm::PPCTargetMachine::isPPC64().
Referenced by eliminateFrameIndex(), getBaseRegister(), and requiresVirtualBaseRegisters().
|
override |
Definition at line 380 of file PPCRegisterInfo.cpp.
References EnableGPRToVecSpills, llvm::TargetRegisterInfo::getLargestLegalSuperClass(), llvm::MachineFunction::getSubtarget(), llvm::PPCSubtarget::hasP8Vector(), llvm::PPCSubtarget::hasP9Vector(), llvm::PPCSubtarget::hasVSX(), and llvm::PPCTargetMachine::isELFv2ABI().
Definition at line 239 of file PPCRegisterInfo.cpp.
Referenced by llvm::PPCTargetLowering::emitEHSjLjSetJmp().
|
override |
getPointerRegClass - Return the register class to use to hold pointers.
This is used for addressing modes.
Definition at line 120 of file PPCRegisterInfo.cpp.
References llvm::PPCTargetMachine::isPPC64().
|
override |
Definition at line 344 of file PPCRegisterInfo.cpp.
References llvm::TargetRegisterClass::getID(), and llvm::PPCFrameLowering::hasFP().
|
override |
Definition at line 248 of file PPCRegisterInfo.cpp.
References assert(), llvm::sys::path::begin(), llvm::MachineFunction::getInfo(), llvm::MachineFunction::getSubtarget(), llvm::PPCSubtarget::hasAltivec(), hasBasePointer(), llvm::MachineFunction::hasInlineAsm(), I, llvm::ARM_PROC::IE, llvm::PPCSubtarget::isDarwinABI(), llvm::TargetMachine::isPositionIndependent(), llvm::PPCTargetMachine::isPPC64(), llvm::PPCSubtarget::isSVR4ABI(), R2, llvm::NVPTX::PTXCvtMode::RM, and llvm::PPCFunctionInfo::usesTOCBasePtr().
Referenced by getCalleeSavedRegsViaCopy(), and isCallerPreservedPhysReg().
bool PPCRegisterInfo::hasBasePointer | ( | const MachineFunction & | MF | ) | const |
Definition at line 1042 of file PPCRegisterInfo.cpp.
References AlwaysBasePointer, EnableBasePointer, and needsFrameBaseReg().
Referenced by llvm::PPCFrameLowering::determineCalleeSaves(), llvm::PPCFrameLowering::determineFrameLayout(), eliminateFrameIndex(), llvm::PPCFrameLowering::emitEpilogue(), llvm::PPCFrameLowering::emitPrologue(), getBaseRegister(), getReservedRegs(), llvm::PPCFrameLowering::processFunctionBeforeFrameFinalized(), llvm::PPCFrameLowering::replaceFPWithRealFP(), and requiresVirtualBaseRegisters().
|
override |
Definition at line 808 of file PPCRegisterInfo.cpp.
References llvm::PPCFunctionInfo::getCRSpillFrameIndex(), llvm::MachineFunction::getInfo(), llvm::MachineFunction::getSubtarget(), llvm::PPCTargetMachine::isPPC64(), and llvm::PPCSubtarget::isSVR4ABI().
Referenced by requiresVirtualBaseRegisters().
|
override |
Definition at line 319 of file PPCRegisterInfo.cpp.
References assert(), llvm::MachineFunction::getFrameInfo(), getReservedRegs(), llvm::MachineFunction::getSubtarget(), llvm::TargetRegisterInfo::isPhysicalRegister(), llvm::PPCTargetMachine::isPPC64(), llvm::PPCSubtarget::isSVR4ABI(), StackPtrConst, and llvm::BitVector::test().
|
override |
Definition at line 1149 of file PPCRegisterInfo.cpp.
References assert(), llvm::MachineOperand::getImm(), getOffsetONFromFION(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::isFI(), llvm::isInt< 16 >(), and offsetMinAlign().
Referenced by needsFrameBaseReg(), and requiresVirtualBaseRegisters().
void PPCRegisterInfo::lowerCRBitRestore | ( | MachineBasicBlock::iterator | II, |
unsigned | FrameIndex | ||
) | const |
Definition at line 705 of file PPCRegisterInfo.cpp.
References llvm::addFrameReference(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::MachineInstr::definesRegister(), llvm::MachineBasicBlock::erase(), llvm::DebugLoc::get(), llvm::getCRFromCRBit(), llvm::MachineInstr::getDebugLoc(), llvm::PPCSubtarget::getInstrInfo(), llvm::MachineInstr::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), llvm::RegState::Implicit, llvm::PPCTargetMachine::isPPC64(), llvm::RegState::Kill, llvm::PPCISD::MFOCRF, MI, Reg, and TII.
Referenced by eliminateFrameIndex(), and requiresVirtualBaseRegisters().
void PPCRegisterInfo::lowerCRBitSpilling | ( | MachineBasicBlock::iterator | II, |
unsigned | FrameIndex | ||
) | const |
Definition at line 658 of file PPCRegisterInfo.cpp.
References llvm::addFrameReference(), llvm::MachineInstrBuilder::addImm(), llvm::BuildMI(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::MachineBasicBlock::erase(), llvm::ISD::FrameIndex, llvm::DebugLoc::get(), llvm::getCRFromCRBit(), llvm::MachineInstr::getDebugLoc(), llvm::PPCSubtarget::getInstrInfo(), llvm::getKillRegState(), llvm::MachineInstr::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), llvm::RegState::Implicit, llvm::MachineOperand::isKill(), llvm::PPCTargetMachine::isPPC64(), llvm::RegState::Kill, llvm::PPCISD::MFOCRF, MI, Reg, TII, and llvm::RegState::Undef.
Referenced by eliminateFrameIndex(), and requiresVirtualBaseRegisters().
void PPCRegisterInfo::lowerCRRestore | ( | MachineBasicBlock::iterator | II, |
unsigned | FrameIndex | ||
) | const |
Definition at line 615 of file PPCRegisterInfo.cpp.
References llvm::addFrameReference(), llvm::MachineInstrBuilder::addImm(), assert(), llvm::BuildMI(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::MachineInstr::definesRegister(), llvm::MachineBasicBlock::erase(), llvm::DebugLoc::get(), llvm::MachineInstr::getDebugLoc(), llvm::PPCSubtarget::getInstrInfo(), llvm::MachineInstr::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), llvm::PPCTargetMachine::isPPC64(), llvm::RegState::Kill, MI, Reg, and TII.
Referenced by eliminateFrameIndex(), and requiresVirtualBaseRegisters().
void PPCRegisterInfo::lowerCRSpilling | ( | MachineBasicBlock::iterator | II, |
unsigned | FrameIndex | ||
) | const |
lowerCRSpilling - Generate the code for spilling a CR register.
Instead of reserving a whole register (R0), we scrounge for one here. This generates code like this:
mfcr rA ; Move the conditional register into GPR rA. rlwinm rA, rA, SB, 0, 31 ; Shift the bits left so they are in CR0's slot. stw rA, FI ; Store rA to the frame.
Definition at line 570 of file PPCRegisterInfo.cpp.
References llvm::addFrameReference(), llvm::MachineInstrBuilder::addImm(), llvm::BuildMI(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::MachineBasicBlock::erase(), llvm::ISD::FrameIndex, llvm::DebugLoc::get(), llvm::MachineInstr::getDebugLoc(), llvm::PPCSubtarget::getInstrInfo(), llvm::getKillRegState(), llvm::MachineInstr::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), llvm::MachineOperand::isKill(), llvm::PPCTargetMachine::isPPC64(), llvm::RegState::Kill, llvm::PPCISD::MFOCRF, MI, Reg, and TII.
Referenced by eliminateFrameIndex(), and requiresVirtualBaseRegisters().
void PPCRegisterInfo::lowerDynamicAlloc | ( | MachineBasicBlock::iterator | II | ) | const |
lowerDynamicAlloc - Generate the code for allocating an object in the current frame.
The sequence of code will be in the general form
addi R0, SP, #frameSize ; get the address of the previous frame stwxu R0, SP, Rnegsize ; add and update the SP with the negated size addi Rnew, SP, #maxCalFrameSize ; get the top of the allocation
Definition at line 421 of file PPCRegisterInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::ISD::AND, assert(), llvm::BuildMI(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::MachineBasicBlock::erase(), llvm::DebugLoc::get(), llvm::MachineInstr::getDebugLoc(), llvm::MachineFunction::getFrameInfo(), llvm::PPCSubtarget::getInstrInfo(), llvm::getKillRegState(), llvm::MachineFrameInfo::getMaxAlignment(), llvm::MachineFrameInfo::getMaxCallFrameSize(), llvm::MachineInstr::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::TargetFrameLowering::getStackAlignment(), llvm::MachineFrameInfo::getStackSize(), llvm::MachineFunction::getSubtarget(), llvm::isInt< 16 >(), llvm::MachineOperand::isKill(), llvm::PPCTargetMachine::isPPC64(), llvm::RegState::Kill, llvm::ARM_MB::LD, MI, Reg, and TII.
Referenced by eliminateFrameIndex(), and requiresVirtualBaseRegisters().
void PPCRegisterInfo::lowerDynamicAreaOffset | ( | MachineBasicBlock::iterator | II | ) | const |
Definition at line 539 of file PPCRegisterInfo.cpp.
References llvm::BuildMI(), llvm::MachineBasicBlock::erase(), llvm::DebugLoc::get(), llvm::MachineInstr::getDebugLoc(), llvm::MachineFunction::getFrameInfo(), llvm::PPCSubtarget::getInstrInfo(), llvm::MachineFrameInfo::getMaxCallFrameSize(), llvm::MachineInstr::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getSubtarget(), is64Bit(), llvm::PPCTargetMachine::isPPC64(), MI, and TII.
Referenced by eliminateFrameIndex(), and requiresVirtualBaseRegisters().
void PPCRegisterInfo::lowerVRSAVERestore | ( | MachineBasicBlock::iterator | II, |
unsigned | FrameIndex | ||
) | const |
Definition at line 781 of file PPCRegisterInfo.cpp.
References llvm::addFrameReference(), assert(), llvm::BuildMI(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::MachineInstr::definesRegister(), llvm::MachineBasicBlock::erase(), llvm::DebugLoc::get(), llvm::MachineInstr::getDebugLoc(), llvm::PPCSubtarget::getInstrInfo(), llvm::MachineInstr::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), llvm::RegState::Kill, MI, Reg, and TII.
Referenced by eliminateFrameIndex(), and requiresVirtualBaseRegisters().
void PPCRegisterInfo::lowerVRSAVESpilling | ( | MachineBasicBlock::iterator | II, |
unsigned | FrameIndex | ||
) | const |
Definition at line 755 of file PPCRegisterInfo.cpp.
References llvm::addFrameReference(), llvm::BuildMI(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::MachineBasicBlock::erase(), llvm::ISD::FrameIndex, llvm::DebugLoc::get(), llvm::MachineInstr::getDebugLoc(), llvm::PPCSubtarget::getInstrInfo(), llvm::getKillRegState(), llvm::MachineInstr::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), llvm::MachineOperand::isKill(), llvm::RegState::Kill, MI, Reg, and TII.
Referenced by eliminateFrameIndex(), and requiresVirtualBaseRegisters().
|
override |
Insert defining instruction(s) for BaseReg to be a pointer to FrameIdx at the beginning of the basic block.
Definition at line 1104 of file PPCRegisterInfo.cpp.
References llvm::MachineInstrBuilder::addFrameIndex(), llvm::MachineInstrBuilder::addImm(), llvm::MachineBasicBlock::begin(), llvm::BuildMI(), llvm::MachineRegisterInfo::constrainRegClass(), llvm::MachineBasicBlock::end(), llvm::PPCSubtarget::getInstrInfo(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), llvm::MipsISD::Ins, llvm::PPCTargetMachine::isPPC64(), MRI, and TII.
Referenced by needsFrameBaseReg(), and requiresVirtualBaseRegisters().
|
override |
Returns true if the instruction's frame index reference would be better served by a base register other than FP or SP.
Used by LocalStackFrameAllocation to determine which frame index references it should create new base registers for.
Definition at line 1059 of file PPCRegisterInfo.cpp.
References assert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::count(), llvm::PPCFrameLowering::determineFrameLayout(), getBaseRegister(), llvm::MachineOperand::getImm(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), isFrameOffsetLegal(), and materializeFrameBaseRegister().
Referenced by hasBasePointer(), and requiresVirtualBaseRegisters().
|
inlineoverride |
Definition at line 93 of file PPCRegisterInfo.h.
|
inlineoverride |
We require the register scavenger.
Definition at line 89 of file PPCRegisterInfo.h.
|
inlineoverride |
Definition at line 101 of file PPCRegisterInfo.h.
References eliminateFrameIndex(), llvm::ISD::FrameIndex, getBaseRegister(), getFrameRegister(), hasBasePointer(), hasReservedSpillSlot(), isFrameOffsetLegal(), lowerCRBitRestore(), lowerCRBitSpilling(), lowerCRRestore(), lowerCRSpilling(), lowerDynamicAlloc(), lowerDynamicAreaOffset(), lowerVRSAVERestore(), lowerVRSAVESpilling(), materializeFrameBaseRegister(), MI, needsFrameBaseReg(), Reg, and resolveFrameIndex().
|
override |
Definition at line 1125 of file PPCRegisterInfo.cpp.
References assert(), llvm::MachineOperand::ChangeToImmediate(), llvm::MachineOperand::ChangeToRegister(), llvm::MachineRegisterInfo::constrainRegClass(), llvm::MachineInstr::getDesc(), llvm::MachineOperand::getImm(), llvm::PPCSubtarget::getInstrInfo(), llvm::MachineInstr::getNumOperands(), getOffsetONFromFION(), llvm::MachineInstr::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), llvm::MachineOperand::isFI(), MRI, and TII.
Referenced by requiresVirtualBaseRegisters().
stripRegisterPrefix - This method strips the character prefix from a register name so that only the number is left.
Used by for linux asm.
Definition at line 145 of file PPCRegisterInfo.h.
Referenced by llvm::PPCInstPrinter::printOperand().
|
inlineoverride |
Definition at line 97 of file PPCRegisterInfo.h.