LLVM 19.0.0git
Macros | Functions | Variables
PPCFrameLowering.cpp File Reference
#include "PPCFrameLowering.h"
#include "MCTargetDesc/PPCPredicates.h"
#include "PPCInstrBuilder.h"
#include "PPCInstrInfo.h"
#include "PPCMachineFunctionInfo.h"
#include "PPCSubtarget.h"
#include "PPCTargetMachine.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/LivePhysRegs.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"

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "framelowering"
 
#define CALLEE_SAVED_FPRS
 
#define CALLEE_SAVED_GPRS32
 
#define CALLEE_SAVED_GPRS64
 
#define CALLEE_SAVED_VRS
 

Functions

 STATISTIC (NumPESpillVSR, "Number of spills to vector in prologue")
 
 STATISTIC (NumPEReloadVSR, "Number of reloads from vector in epilogue")
 
 STATISTIC (NumPrologProbed, "Number of prologues probed")
 
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 unsigned computeCRSaveOffset (const PPCSubtarget &STI)
 
static bool spillsCR (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.
 
static void restoreCRs (bool is31, bool CR2Spilled, bool CR3Spilled, bool CR4Spilled, MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, ArrayRef< CalleeSavedInfo > CSI, unsigned CSIIndex)
 
static bool isCalleeSavedCR (unsigned Reg)
 

Variables

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

Macro Definition Documentation

◆ CALLEE_SAVED_FPRS

#define CALLEE_SAVED_FPRS
Value:
{PPC::F31, -8}, \
{PPC::F30, -16}, \
{PPC::F29, -24}, \
{PPC::F28, -32}, \
{PPC::F27, -40}, \
{PPC::F26, -48}, \
{PPC::F25, -56}, \
{PPC::F24, -64}, \
{PPC::F23, -72}, \
{PPC::F22, -80}, \
{PPC::F21, -88}, \
{PPC::F20, -96}, \
{PPC::F19, -104}, \
{PPC::F18, -112}, \
{PPC::F17, -120}, \
{PPC::F16, -128}, \
{PPC::F15, -136}, \
{PPC::F14, -144}

◆ CALLEE_SAVED_GPRS32

#define CALLEE_SAVED_GPRS32
Value:
{PPC::R31, -4}, \
{PPC::R30, -8}, \
{PPC::R29, -12}, \
{PPC::R28, -16}, \
{PPC::R27, -20}, \
{PPC::R26, -24}, \
{PPC::R25, -28}, \
{PPC::R24, -32}, \
{PPC::R23, -36}, \
{PPC::R22, -40}, \
{PPC::R21, -44}, \
{PPC::R20, -48}, \
{PPC::R19, -52}, \
{PPC::R18, -56}, \
{PPC::R17, -60}, \
{PPC::R16, -64}, \
{PPC::R15, -68}, \
{PPC::R14, -72}

◆ CALLEE_SAVED_GPRS64

#define CALLEE_SAVED_GPRS64
Value:
{PPC::X31, -8}, \
{PPC::X30, -16}, \
{PPC::X29, -24}, \
{PPC::X28, -32}, \
{PPC::X27, -40}, \
{PPC::X26, -48}, \
{PPC::X25, -56}, \
{PPC::X24, -64}, \
{PPC::X23, -72}, \
{PPC::X22, -80}, \
{PPC::X21, -88}, \
{PPC::X20, -96}, \
{PPC::X19, -104}, \
{PPC::X18, -112}, \
{PPC::X17, -120}, \
{PPC::X16, -128}, \
{PPC::X15, -136}, \
{PPC::X14, -144}

◆ CALLEE_SAVED_VRS

#define CALLEE_SAVED_VRS
Value:
{PPC::V31, -16}, \
{PPC::V30, -32}, \
{PPC::V29, -48}, \
{PPC::V28, -64}, \
{PPC::V27, -80}, \
{PPC::V26, -96}, \
{PPC::V25, -112}, \
{PPC::V24, -128}, \
{PPC::V23, -144}, \
{PPC::V22, -160}, \
{PPC::V21, -176}, \
{PPC::V20, -192}

◆ DEBUG_TYPE

#define DEBUG_TYPE   "framelowering"

Definition at line 33 of file PPCFrameLowering.cpp.

Function Documentation

◆ computeBasePointerSaveOffset()

static unsigned computeBasePointerSaveOffset ( const PPCSubtarget STI)
static

◆ computeCRSaveOffset()

static unsigned computeCRSaveOffset ( const PPCSubtarget STI)
static

◆ computeFramePointerSaveOffset()

static unsigned computeFramePointerSaveOffset ( const PPCSubtarget STI)
static

Definition at line 56 of file PPCFrameLowering.cpp.

References llvm::PPCSubtarget::isPPC64().

◆ computeLinkageSize()

static unsigned computeLinkageSize ( const PPCSubtarget STI)
static

◆ computeReturnSaveOffset()

static unsigned computeReturnSaveOffset ( const PPCSubtarget STI)
static

◆ computeTOCSaveOffset()

static unsigned computeTOCSaveOffset ( const PPCSubtarget STI)
static

◆ hasNonRISpills()

static bool hasNonRISpills ( const MachineFunction MF)
static

◆ hasSpills()

static bool hasSpills ( const MachineFunction MF)
static

◆ isCalleeSavedCR()

static bool isCalleeSavedCR ( unsigned  Reg)
static

◆ MustSaveLR()

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

◆ restoreCRs()

static void restoreCRs ( bool  is31,
bool  CR2Spilled,
bool  CR3Spilled,
bool  CR4Spilled,
MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
ArrayRef< CalleeSavedInfo CSI,
unsigned  CSIIndex 
)
static

◆ spillsCR()

static bool spillsCR ( const MachineFunction MF)
static

◆ STATISTIC() [1/3]

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

◆ STATISTIC() [2/3]

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

◆ STATISTIC() [3/3]

STATISTIC ( NumPrologProbed  ,
"Number of prologues probed"   
)

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) ( "ppc-enable-pe-vector-spills"  ,
cl::desc("Enable spills in prologue to vector registers.")  ,
cl::init(false)  ,
cl::Hidden   
)
static