LLVM API Documentation
#include "XCoreFrameLowering.h"
#include "XCore.h"
#include "XCoreInstrInfo.h"
#include "XCoreMachineFunctionInfo.h"
#include "XCoreSubtarget.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/DataLayout.h"
#include "llvm/IR/Function.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetOptions.h"
#include <algorithm>
Go to the source code of this file.
static bool CompareSSIOffset | ( | const StackSlotInfo & | a, |
const StackSlotInfo & | b | ||
) | [static] |
Definition at line 57 of file XCoreFrameLowering.cpp.
Referenced by GetEHSpillList(), and GetSpillList().
static void EmitCfiOffset | ( | MachineBasicBlock & | MBB, |
MachineBasicBlock::iterator | MBBI, | ||
DebugLoc | dl, | ||
const TargetInstrInfo & | TII, | ||
MachineModuleInfo * | MMI, | ||
unsigned | DRegNum, | ||
int | Offset | ||
) | [static] |
Definition at line 82 of file XCoreFrameLowering.cpp.
References llvm::MachineModuleInfo::addFrameInst(), llvm::BuildMI(), llvm::TargetOpcode::CFI_INSTRUCTION, llvm::MCCFIInstruction::createOffset(), and llvm::MCInstrInfo::get().
Referenced by llvm::XCoreFrameLowering::emitPrologue().
static void EmitDefCfaOffset | ( | MachineBasicBlock & | MBB, |
MachineBasicBlock::iterator | MBBI, | ||
DebugLoc | dl, | ||
const TargetInstrInfo & | TII, | ||
MachineModuleInfo * | MMI, | ||
int | Offset | ||
) | [static] |
Definition at line 72 of file XCoreFrameLowering.cpp.
References llvm::MachineModuleInfo::addFrameInst(), llvm::BuildMI(), llvm::TargetOpcode::CFI_INSTRUCTION, llvm::MCCFIInstruction::createDefCfaOffset(), and llvm::MCInstrInfo::get().
Referenced by llvm::XCoreFrameLowering::emitPrologue(), and IfNeededExtSP().
static void EmitDefCfaRegister | ( | MachineBasicBlock & | MBB, |
MachineBasicBlock::iterator | MBBI, | ||
DebugLoc | dl, | ||
const TargetInstrInfo & | TII, | ||
MachineModuleInfo * | MMI, | ||
unsigned | DRegNum | ||
) | [static] |
Definition at line 62 of file XCoreFrameLowering.cpp.
References llvm::MachineModuleInfo::addFrameInst(), llvm::BuildMI(), llvm::TargetOpcode::CFI_INSTRUCTION, llvm::MCCFIInstruction::createDefCfaRegister(), and llvm::MCInstrInfo::get().
Referenced by llvm::XCoreFrameLowering::emitPrologue().
static void GetEHSpillList | ( | SmallVectorImpl< StackSlotInfo > & | SpillList, |
MachineFrameInfo * | MFI, | ||
XCoreFunctionInfo * | XFI, | ||
const TargetLowering * | TL | ||
) | [static] |
Creates an ordered list of EH info register 'spills'. These slots are only used by the unwinder and calls to llvm.eh.return(). Registers are ordered according to their frame offset. As offsets are negative, the largest offsets will be first.
Definition at line 161 of file XCoreFrameLowering.cpp.
References llvm::SmallVectorTemplateCommon< T >::begin(), CompareSSIOffset(), llvm::SmallVectorTemplateCommon< T >::end(), llvm::XCoreFunctionInfo::getEHSpillSlot(), llvm::TargetLoweringBase::getExceptionPointerRegister(), llvm::TargetLoweringBase::getExceptionSelectorRegister(), llvm::MachineFrameInfo::getObjectOffset(), llvm::XCoreFunctionInfo::hasEHSpillSlot(), and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().
Referenced by llvm::XCoreFrameLowering::emitEpilogue(), and llvm::XCoreFrameLowering::emitPrologue().
static MachineMemOperand* getFrameIndexMMO | ( | MachineBasicBlock & | MBB, |
int | FrameIndex, | ||
unsigned | flags | ||
) | [static] |
Definition at line 177 of file XCoreFrameLowering.cpp.
References llvm::MachinePointerInfo::getFixedStack(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getMachineMemOperand(), llvm::MachineFrameInfo::getObjectAlignment(), llvm::MachineFrameInfo::getObjectSize(), and llvm::MachineBasicBlock::getParent().
Referenced by llvm::XCoreFrameLowering::emitPrologue(), and RestoreSpillList().
static void GetSpillList | ( | SmallVectorImpl< StackSlotInfo > & | SpillList, |
MachineFrameInfo * | MFI, | ||
XCoreFunctionInfo * | XFI, | ||
bool | fetchLR, | ||
bool | fetchFP | ||
) | [static] |
Creates an ordered list of registers that are spilled during the emitPrologue/emitEpilogue. Registers are ordered according to their frame offset. As offsets are negative, the largest offsets will be first.
Definition at line 139 of file XCoreFrameLowering.cpp.
References llvm::SmallVectorTemplateCommon< T >::begin(), CompareSSIOffset(), llvm::SmallVectorTemplateCommon< T >::end(), FramePtr, llvm::XCoreFunctionInfo::getFPSpillSlot(), llvm::XCoreFunctionInfo::getLRSpillSlot(), llvm::MachineFrameInfo::getObjectOffset(), and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().
Referenced by llvm::XCoreFrameLowering::emitEpilogue(), and llvm::XCoreFrameLowering::emitPrologue().
static void IfNeededExtSP | ( | MachineBasicBlock & | MBB, |
MachineBasicBlock::iterator | MBBI, | ||
DebugLoc | dl, | ||
const TargetInstrInfo & | TII, | ||
MachineModuleInfo * | MMI, | ||
int | OffsetFromTop, | ||
int & | Adjusted, | ||
int | FrameSize, | ||
bool | emitFrameMoves | ||
) | [static] |
The SP register is moved in steps of 'MaxImmU16' towards the bottom of the frame. During these steps, it may be necessary to spill registers. IfNeededExtSP emits the necessary EXTSP instructions to move the SP only as far as to make 'OffsetFromBottom' reachable using an STWSP_lru6.
OffsetFromTop | the spill offset from the top of the frame. | |
[in,out] | Adjusted | the current SP offset from the top of the frame. |
Definition at line 98 of file XCoreFrameLowering.cpp.
References llvm::BuildMI(), EmitDefCfaOffset(), llvm::MCInstrInfo::get(), isImmU6(), and MaxImmU16.
Referenced by llvm::XCoreFrameLowering::emitPrologue().
static void IfNeededLDAWSP | ( | MachineBasicBlock & | MBB, |
MachineBasicBlock::iterator | MBBI, | ||
DebugLoc | dl, | ||
const TargetInstrInfo & | TII, | ||
int | OffsetFromTop, | ||
int & | RemainingAdj | ||
) | [static] |
The SP register is moved in steps of 'MaxImmU16' towards the top of the frame. During these steps, it may be necessary to re-load registers. IfNeededLDAWSP emits the necessary LDAWSP instructions to move the SP only as far as to make 'OffsetFromTop' reachable using an LDAWSP_lru6.
OffsetFromTop | the spill offset from the top of the frame. | |
[in,out] | RemainingAdj | the current SP offset from the top of the frame. |
Definition at line 122 of file XCoreFrameLowering.cpp.
References llvm::BuildMI(), llvm::MCInstrInfo::get(), isImmU6(), and MaxImmU16.
Referenced by llvm::XCoreFrameLowering::emitEpilogue(), and RestoreSpillList().
Definition at line 43 of file XCoreFrameLowering.cpp.
Referenced by llvm::XCoreFrameLowering::eliminateCallFramePseudoInstr().
Definition at line 39 of file XCoreFrameLowering.cpp.
Referenced by llvm::XCoreFrameLowering::eliminateCallFramePseudoInstr(), llvm::XCoreFrameLowering::emitEpilogue(), llvm::XCoreFrameLowering::emitPrologue(), IfNeededExtSP(), IfNeededLDAWSP(), and RestoreSpillList().
static void RestoreSpillList | ( | MachineBasicBlock & | MBB, |
MachineBasicBlock::iterator | MBBI, | ||
DebugLoc | dl, | ||
const TargetInstrInfo & | TII, | ||
int & | RemainingAdj, | ||
SmallVectorImpl< StackSlotInfo > & | SpillList | ||
) | [static] |
Restore clobbered registers with their spill slot value. The SP will be adjusted at the same time, thus the SpillList must be ordered with the largest (negative) offsets first.
Definition at line 192 of file XCoreFrameLowering.cpp.
References llvm::MachineInstrBuilder::addMemOperand(), llvm::BuildMI(), llvm::MCInstrInfo::get(), getFrameIndexMMO(), IfNeededLDAWSP(), isImmU6(), llvm::MachineMemOperand::MOLoad, and llvm::SmallVectorTemplateCommon< T >::size().
Referenced by llvm::XCoreFrameLowering::emitEpilogue().
Definition at line 35 of file XCoreFrameLowering.cpp.
Referenced by llvm::SparcRegisterInfo::eliminateFrameIndex(), llvm::Thumb1FrameLowering::emitEpilogue(), llvm::ARMFrameLowering::emitEpilogue(), llvm::XCoreFrameLowering::emitEpilogue(), llvm::X86FrameLowering::emitEpilogue(), llvm::XCoreFrameLowering::emitPrologue(), llvm::Thumb1FrameLowering::emitPrologue(), llvm::ARMFrameLowering::emitPrologue(), llvm::AArch64FrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), GetSpillList(), and llvm::ARMFrameLowering::processFunctionBeforeCalleeSavedScan().
Definition at line 36 of file XCoreFrameLowering.cpp.
Referenced by llvm::XCoreFrameLowering::emitPrologue(), IfNeededExtSP(), and IfNeededLDAWSP().