LLVM: lib/Target/Hexagon/HexagonFrameLowering.cpp File Reference (original) (raw)

Go to the source code of this file.

Namespaces
namespace llvm
This is an optimization pass for GlobalISel generic memory operations.
Functions
void llvm::initializeHexagonCallFrameInformationPass (PassRegistry &)
FunctionPass * llvm::createHexagonCallFrameInformation ()
INITIALIZE_PASS (HexagonCallFrameInformation, "hexagon-cfi", "Hexagon call frame information", false, false) FunctionPass *llvm
static Register getMax32BitSubRegister (Register Reg, const TargetRegisterInfo &TRI, bool hireg=true)
Map a register pair Reg to the subregister that has the greater "number", i.e.
static Register getMaxCalleeSavedReg (ArrayRef< CalleeSavedInfo > CSI, const TargetRegisterInfo &TRI)
Returns the callee saved register with the largest id in the vector.
static bool needsStackFrame (const MachineBasicBlock &MBB, const BitVector &CSR, const HexagonRegisterInfo &HRI)
Checks if the basic block contains any instruction that needs a stack frame to be already in place.
static bool hasTailCall (const MachineBasicBlock &MBB)
Returns true if MBB has a machine instructions that indicates a tail call in the block.
static bool hasReturn (const MachineBasicBlock &MBB)
Returns true if MBB contains an instruction that returns.
static MachineInstr * getReturn (MachineBasicBlock &MBB)
Returns the "return" instruction from this block, or nullptr if there isn't any.
static bool isRestoreCall (unsigned Opc)
static bool isOptNone (const MachineFunction &MF)
static bool isOptSize (const MachineFunction &MF)
static bool isMinSize (const MachineFunction &MF)
static bool enableAllocFrameElim (const MachineFunction &MF)
static std::optional< MachineBasicBlock::iterator > findCFILocation (MachineBasicBlock &B)
static const char * getSpillFunctionFor (Register MaxReg, SpillKind SpillType, bool Stkchk=false)
static bool needToReserveScavengingSpillSlots (MachineFunction &MF, const HexagonRegisterInfo &HRI, const TargetRegisterClass *RC)
Returns true if there are no caller-saved registers available in class RC.
static void dump_registers (BitVector &Regs, const TargetRegisterInfo &TRI)
Variables
static cl::opt< bool > DisableDeallocRet ("disable-hexagon-dealloc-ret", cl::Hidden, cl::desc("Disable Dealloc Return for Hexagon target"))
static cl::opt< unsigned > NumberScavengerSlots ("number-scavenger-slots", cl::Hidden, cl::desc("Set the number of scavenger slots"), cl::init(2))
static cl::opt< int > SpillFuncThreshold ("spill-func-threshold", cl::Hidden, cl::desc("Specify O2(not Os) spill func threshold"), cl::init(6))
static cl::opt< int > SpillFuncThresholdOs ("spill-func-threshold-Os", cl::Hidden, cl::desc("Specify Os spill func threshold"), cl::init(1))
static cl::opt< bool > EnableStackOVFSanitizer ("enable-stackovf-sanitizer", cl::Hidden, cl::desc("Enable runtime checks for stack overflow."), cl::init(false))
static cl::opt< bool > EnableShrinkWrapping ("hexagon-shrink-frame", cl::init(true), cl::Hidden, cl::desc("Enable stack frame shrink wrapping"))
static cl::opt< unsigned > ShrinkLimit ("shrink-frame-limit", cl::init(std::numeric_limits< unsigned >::max()), cl::Hidden, cl::desc("Max count of stack frame shrink-wraps"))
static cl::opt< bool > EnableSaveRestoreLong ("enable-save-restore-long", cl::Hidden, cl::desc("Enable long calls for save-restore stubs."), cl::init(false))
static cl::opt< bool > EliminateFramePointer ("hexagon-fp-elim", cl::init(true), cl::Hidden, cl::desc("Refrain from using FP whenever possible"))
static cl::opt< bool > OptimizeSpillSlots ("hexagon-opt-spill", cl::Hidden, cl::init(true), cl::desc("Optimize spill slots"))
static cl::opt< unsigned > SpillOptMax ("spill-opt-max", cl::Hidden, cl::init(std::numeric_limits< unsigned >::max()))
static unsigned SpillOptCount = 0

DEBUG_TYPE

#define DEBUG_TYPE "hexagon-pei"

SpillKind

dump_registers()

enableAllocFrameElim()

findCFILocation()

getMax32BitSubRegister()

getMaxCalleeSavedReg()

getReturn()

getSpillFunctionFor()

hasReturn()

hasTailCall()

INITIALIZE_PASS()

INITIALIZE_PASS ( HexagonCallFrameInformation ,
"hexagon-cfi" ,
"Hexagon call frame information" ,
false ,
false
)

isMinSize()

isOptNone()

isOptSize()

isRestoreCall()

needsStackFrame()

needToReserveScavengingSpillSlots()

DisableDeallocRet

cl::opt< bool > DisableDeallocRet("disable-hexagon-dealloc-ret", cl::Hidden, cl::desc("Disable Dealloc Return for Hexagon target")) ( "disable-hexagon-dealloc-ret" , cl::Hidden , cl::desc("Disable Dealloc Return for Hexagon target") ) static

EliminateFramePointer

cl::opt< bool > EliminateFramePointer("hexagon-fp-elim", cl::init(true), cl::Hidden, cl::desc("Refrain from using FP whenever possible")) ( "hexagon-fp-elim" , cl::init(true) , cl::Hidden , cl::desc("Refrain from using FP whenever possible") ) static

EnableSaveRestoreLong

cl::opt< bool > EnableSaveRestoreLong("enable-save-restore-long", cl::Hidden, cl::desc("Enable long calls for save-restore stubs."), cl::init(false)) ( "enable-save-restore-long" , cl::Hidden , cl::desc("Enable long calls for save-restore stubs.") , cl::init(false) ) static

EnableShrinkWrapping

cl::opt< bool > EnableShrinkWrapping("hexagon-shrink-frame", cl::init(true), cl::Hidden, cl::desc("Enable stack frame shrink wrapping")) ( "hexagon-shrink-frame" , cl::init(true) , cl::Hidden , cl::desc("Enable stack frame shrink wrapping") ) static

EnableStackOVFSanitizer

cl::opt< bool > EnableStackOVFSanitizer("enable-stackovf-sanitizer", cl::Hidden, cl::desc("Enable runtime checks for stack overflow."), cl::init(false)) ( "enable-stackovf-sanitizer" , cl::Hidden , cl::desc("Enable runtime checks for stack overflow.") , cl::init(false) ) static

NumberScavengerSlots

cl::opt< unsigned > NumberScavengerSlots("number-scavenger-slots", cl::Hidden, cl::desc("Set the number of scavenger slots"), cl::init(2)) ( "number-scavenger-slots" , cl::Hidden , cl::desc("Set the number of scavenger slots") , cl::init(2) ) static

OptimizeSpillSlots

cl::opt< bool > OptimizeSpillSlots("hexagon-opt-spill", cl::Hidden, cl::init(true), cl::desc("Optimize spill slots")) ( "hexagon-opt-spill" , cl::Hidden , cl::init(true) , cl::desc("Optimize spill slots") ) static

ShrinkLimit

cl::opt< unsigned > ShrinkLimit("shrink-frame-limit", cl::init(std::numeric_limits< unsigned >::max()), cl::Hidden, cl::desc("Max count of stack frame shrink-wraps")) ( "shrink-frame-limit" , cl::init(std::numeric_limits< unsigned >::max()) , cl::Hidden , cl::desc("Max count of stack frame shrink-wraps") ) static

SpillFuncThreshold

cl::opt< int > SpillFuncThreshold("spill-func-threshold", cl::Hidden, cl::desc("Specify O2(not Os) spill func threshold"), cl::init(6)) ( "spill-func-threshold" , cl::Hidden , cl::desc("Specify O2(not Os) spill func threshold") , cl::init(6) ) static

SpillFuncThresholdOs

cl::opt< int > SpillFuncThresholdOs("spill-func-threshold-Os", cl::Hidden, cl::desc("Specify Os spill func threshold"), cl::init(1)) ( "spill-func-threshold-Os" , cl::Hidden , cl::desc("Specify Os spill func threshold") , cl::init(1) ) static

SpillOptCount

SpillOptMax

cl::opt< unsigned > SpillOptMax("spill-opt-max", cl::Hidden, cl::init(std::numeric_limits< unsigned >::max())) ( "spill-opt-max" , cl::Hidden , cl::init(std::numeric_limits< unsigned >::max()) ) static