LLVM API Documentation
#include "PPC.h"#include "PPCInstrBuilder.h"#include "PPCMachineFunctionInfo.h"#include "PPCRegisterInfo.h"#include "PPCFrameInfo.h"#include "PPCSubtarget.h"#include "llvm/CallingConv.h"#include "llvm/Constants.h"#include "llvm/Function.h"#include "llvm/Type.h"#include "llvm/CodeGen/ValueTypes.h"#include "llvm/CodeGen/MachineInstrBuilder.h"#include "llvm/CodeGen/MachineModuleInfo.h"#include "llvm/CodeGen/MachineFunction.h"#include "llvm/CodeGen/MachineFrameInfo.h"#include "llvm/CodeGen/MachineLocation.h"#include "llvm/CodeGen/MachineRegisterInfo.h"#include "llvm/CodeGen/RegisterScavenging.h"#include "llvm/Target/TargetFrameInfo.h"#include "llvm/Target/TargetInstrInfo.h"#include "llvm/Target/TargetMachine.h"#include "llvm/Target/TargetOptions.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/Debug.h"#include "llvm/Support/MathExtras.h"#include "llvm/ADT/BitVector.h"#include "llvm/ADT/STLExtras.h"#include <cstdlib>#include "PPCGenRegisterInfo.inc"
Go to the source code of this file.
Defines | |
| #define | DEBUG_TYPE "reginfo" |
| #define | ALIGN_STACK 0 |
| #define | EnableRegisterScavenging |
Functions | |
| static bool | needsFP (const MachineFunction &MF) |
| static bool | spillsCR (const MachineFunction &MF) |
| static bool | MustSaveLR (const MachineFunction &MF, unsigned LR) |
| static unsigned | findScratchRegister (MachineBasicBlock::iterator II, RegScavenger *RS, const TargetRegisterClass *RC, int SPAdj) |
| static void | RemoveVRSaveCode (MachineInstr *MI) |
| static void | HandleVRSaveUpdate (MachineInstr *MI, const TargetInstrInfo &TII) |
Variables | |
| cl::opt< bool > | EnablePPC32RS ("enable-ppc32-regscavenger", cl::init(false), cl::desc("Enable PPC32 register scavenger"), cl::Hidden) |
| cl::opt< bool > | EnablePPC64RS ("enable-ppc64-regscavenger", cl::init(false), cl::desc("Enable PPC64 register scavenger"), cl::Hidden) |
| static const unsigned short | VRRegNo [] |
| #define ALIGN_STACK 0 |
Definition at line 54 of file PPCRegisterInfo.cpp.
Referenced by llvm::PPCRegisterInfo::determineFrameLayout(), llvm::PPCRegisterInfo::emitEpilogue(), and llvm::PPCRegisterInfo::emitPrologue().
| #define DEBUG_TYPE "reginfo" |
Definition at line 15 of file PPCRegisterInfo.cpp.
| #define EnableRegisterScavenging |
Value:
((EnablePPC32RS && !Subtarget.isPPC64()) || \ (EnablePPC64RS && Subtarget.isPPC64()))
Definition at line 65 of file PPCRegisterInfo.cpp.
Referenced by llvm::PPCRegisterInfo::eliminateFrameIndex(), llvm::PPCRegisterInfo::getReservedRegs(), llvm::PPCRegisterInfo::lowerDynamicAlloc(), llvm::PPCRegisterInfo::processFunctionBeforeCalleeSavedScan(), and llvm::PPCRegisterInfo::requiresRegisterScavenging().
| static unsigned findScratchRegister | ( | MachineBasicBlock::iterator | II, | |
| RegScavenger * | RS, | |||
| const TargetRegisterClass * | RC, | |||
| int | SPAdj | |||
| ) | [static] |
findScratchRegister - Find a 'free' PPC register. Try for a call-clobbered register first and then a spilled callee-saved register if that fails.
Definition at line 445 of file PPCRegisterInfo.cpp.
References llvm::RegScavenger::FindUnusedReg(), Reg, and llvm::RegScavenger::scavengeRegister().
| static void HandleVRSaveUpdate | ( | MachineInstr * | MI, | |
| const TargetInstrInfo & | TII | |||
| ) | [static] |
Definition at line 807 of file PPCRegisterInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::BuildMI(), E, llvm::MachineInstr::eraseFromParent(), llvm::TargetInstrInfo::get(), llvm::MachineInstr::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::PPCRegisterInfo::getRegisterNumbering(), llvm::MachineRegisterInfo::isPhysRegUsed(), llvm::MachineRegisterInfo::livein_begin(), llvm::MachineRegisterInfo::livein_end(), llvm::MachineRegisterInfo::liveout_begin(), llvm::MachineRegisterInfo::liveout_end(), MF, and RemoveVRSaveCode().
Referenced by llvm::PPCRegisterInfo::emitPrologue().
| static bool MustSaveLR | ( | const MachineFunction & | MF, | |
| unsigned | LR | |||
| ) | [static] |
MustSaveLR - Return true if this function requires that we save the LR register onto the stack in the prolog and restore it in the epilog of the function.
Definition at line 393 of file PPCRegisterInfo.cpp.
References llvm::MachineRegisterInfo::def_begin(), llvm::MachineRegisterInfo::def_end(), llvm::MachineFunction::getInfo(), llvm::MachineFunction::getRegInfo(), llvm::PPCFunctionInfo::isLRStoreRequired(), and MFI.
Referenced by llvm::PPCRegisterInfo::emitEpilogue(), llvm::PPCRegisterInfo::emitPrologue(), and llvm::PPCRegisterInfo::processFunctionBeforeCalleeSavedScan().
| static bool needsFP | ( | const MachineFunction & | MF | ) | [static] |
Definition at line 333 of file PPCRegisterInfo.cpp.
References llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getInfo(), llvm::MachineFrameInfo::hasVarSizedObjects(), MFI, llvm::NoFramePointerElim, and llvm::PerformTailCallOpt.
| static void RemoveVRSaveCode | ( | MachineInstr * | MI | ) | [static] |
RemoveVRSaveCode - We have found that this function does not need any code to manipulate the VRSAVE register, even though it uses vector registers. This can happen when the only registers used are known to be live in or out of the function. Remove all of the VRSAVE related code from the function.
Definition at line 761 of file PPCRegisterInfo.cpp.
References llvm::MachineBasicBlock::begin(), llvm::MachineFunction::begin(), E, llvm::MachineFunction::end(), llvm::MachineBasicBlock::end(), Entry, llvm::MachineInstr::eraseFromParent(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), MBBI, and MF.
Referenced by HandleVRSaveUpdate().
| static bool spillsCR | ( | const MachineFunction & | MF | ) | [static] |
Definition at line 339 of file PPCRegisterInfo.cpp.
References llvm::MachineFunction::getInfo(), and llvm::PPCFunctionInfo::isCRSpilled().
Referenced by llvm::PPCRegisterInfo::processFunctionBeforeCalleeSavedScan().
| cl::opt<bool> EnablePPC32RS("enable-ppc32-regscavenger", cl::init(false), cl::desc("Enable PPC32 register scavenger"), cl::Hidden) |
| cl::opt<bool> EnablePPC64RS("enable-ppc64-regscavenger", cl::init(false), cl::desc("Enable PPC64 register scavenger"), cl::Hidden) |
Initial value:
{
PPC::V0 , PPC::V1 , PPC::V2 , PPC::V3 , PPC::V4 , PPC::V5 , PPC::V6 , PPC::V7 ,
PPC::V8 , PPC::V9 , PPC::V10, PPC::V11, PPC::V12, PPC::V13, PPC::V14, PPC::V15,
PPC::V16, PPC::V17, PPC::V18, PPC::V19, PPC::V20, PPC::V21, PPC::V22, PPC::V23,
PPC::V24, PPC::V25, PPC::V26, PPC::V27, PPC::V28, PPC::V29, PPC::V30, PPC::V31
}
Definition at line 750 of file PPCRegisterInfo.cpp.