LLVM  8.0.1
Macros | Functions | Variables
PPCFrameLowering.cpp File Reference
#include "PPCFrameLowering.h"
#include "PPCInstrBuilder.h"
#include "PPCInstrInfo.h"
#include "PPCMachineFunctionInfo.h"
#include "PPCSubtarget.h"
#include "PPCTargetMachine.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/RegisterScavenging.h"
#include "llvm/IR/Function.h"
#include "llvm/Target/TargetOptions.h"
Include dependency graph for PPCFrameLowering.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "framelowering"
 

Functions

 STATISTIC (NumNoNeedForFrame, "Number of functions without frames")
 
 STATISTIC (NumPESpillVSR, "Number of spills to vector in prologue")
 
 STATISTIC (NumPEReloadVSR, "Number of reloads from vector in epilogue")
 
static unsigned computeReturnSaveOffset (const PPCSubtarget &STI)
 
static unsigned computeTOCSaveOffset (const PPCSubtarget &STI)
 
static unsigned computeFramePointerSaveOffset (const PPCSubtarget &STI)
 
static unsigned computeLinkageSize (const PPCSubtarget &STI)
 
static unsigned computeBasePointerSaveOffset (const PPCSubtarget &STI)
 
static void RemoveVRSaveCode (MachineInstr &MI)
 RemoveVRSaveCode - We have found that this function does not need any code to manipulate the VRSAVE register, even though it uses vector registers. More...
 
static void HandleVRSaveUpdate (MachineInstr &MI, const TargetInstrInfo &TII)
 
static bool spillsCR (const MachineFunction &MF)
 
static bool spillsVRSAVE (const MachineFunction &MF)
 
static bool hasSpills (const MachineFunction &MF)
 
static bool hasNonRISpills (const MachineFunction &MF)
 
static bool MustSaveLR (const MachineFunction &MF, unsigned LR)
 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. More...
 
static void restoreCRs (bool isPPC64, bool is31, bool CR2Spilled, bool CR3Spilled, bool CR4Spilled, MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const std::vector< CalleeSavedInfo > &CSI, unsigned CSIIndex)
 

Variables

static cl::opt< boolEnablePEVectorSpills ("ppc-enable-pe-vector-spills", cl::desc("Enable spills in prologue to vector registers."), cl::init(false), cl::Hidden)
 
static const MCPhysReg VRRegNo []
 VRRegNo - Map from a numbered VR register to its enum value. More...
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "framelowering"

Definition at line 32 of file PPCFrameLowering.cpp.

Function Documentation

◆ computeBasePointerSaveOffset()

static unsigned computeBasePointerSaveOffset ( const PPCSubtarget STI)
static

◆ computeFramePointerSaveOffset()

static unsigned computeFramePointerSaveOffset ( const PPCSubtarget STI)
static

◆ computeLinkageSize()

static unsigned computeLinkageSize ( const PPCSubtarget STI)
static

◆ computeReturnSaveOffset()

static unsigned computeReturnSaveOffset ( const PPCSubtarget STI)
static

◆ computeTOCSaveOffset()

static unsigned computeTOCSaveOffset ( const PPCSubtarget STI)
static

Definition at line 58 of file PPCFrameLowering.cpp.

References llvm::PPCSubtarget::isELFv2ABI().

◆ HandleVRSaveUpdate()

static void HandleVRSaveUpdate ( MachineInstr MI,
const TargetInstrInfo TII 
)
static

◆ hasNonRISpills()

static bool hasNonRISpills ( const MachineFunction MF)
static

◆ hasSpills()

static bool hasSpills ( const MachineFunction MF)
static

◆ MustSaveLR()

static bool MustSaveLR ( const MachineFunction MF,
unsigned  LR 
)
static

◆ RemoveVRSaveCode()

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. FIXME: The removal of the code results in a compile failure at -O0 when the function contains a function call, as the GPR containing original VRSAVE contents is spilled and reloaded around the call. Without the prolog code, the spill instruction refers to an undefined register. This code needs to account for all uses of that GPR.

Definition at line 287 of file PPCFrameLowering.cpp.

References assert(), llvm::MachineBasicBlock::begin(), llvm::MachineFunction::begin(), E, llvm::MachineBasicBlock::end(), llvm::MachineFunction::end(), llvm::MachineInstr::eraseFromParent(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), I, and MI.

Referenced by HandleVRSaveUpdate().

◆ restoreCRs()

static void restoreCRs ( bool  isPPC64,
bool  is31,
bool  CR2Spilled,
bool  CR3Spilled,
bool  CR4Spilled,
MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
const std::vector< CalleeSavedInfo > &  CSI,
unsigned  CSIIndex 
)
static

◆ spillsCR()

static bool spillsCR ( const MachineFunction MF)
static

◆ spillsVRSAVE()

static bool spillsVRSAVE ( const MachineFunction MF)
static

◆ STATISTIC() [1/3]

STATISTIC ( NumNoNeedForFrame  ,
"Number of functions without frames"   
)

◆ STATISTIC() [2/3]

STATISTIC ( NumPESpillVSR  ,
"Number of spills to vector in prologue"   
)

◆ STATISTIC() [3/3]

STATISTIC ( NumPEReloadVSR  ,
"Number of reloads from vector in epilogue"   
)

Variable Documentation

◆ EnablePEVectorSpills

cl::opt<bool> EnablePEVectorSpills("ppc-enable-pe-vector-spills", cl::desc("Enable spills in prologue to vector registers."), cl::init(false), cl::Hidden)
static

◆ VRRegNo

const MCPhysReg 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 44 of file PPCFrameLowering.cpp.