LLVM API Documentation

PPCRegisterInfo.cpp File Reference

#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"

Include dependency graph for PPCRegisterInfo.cpp:

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 Documentation

#define ALIGN_STACK   0

#define DEBUG_TYPE   "reginfo"

Definition at line 15 of file PPCRegisterInfo.cpp.

#define EnableRegisterScavenging


Function Documentation

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]

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]

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]


Variable Documentation

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)

const unsigned short VRRegNo[] [static]

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
}
VRRegNo - Map from a numbered VR register to its enum value.

Definition at line 750 of file PPCRegisterInfo.cpp.