#include "SystemZFrameLowering.h"
#include "SystemZCallingConv.h"
#include "SystemZInstrBuilder.h"
#include "SystemZInstrInfo.h"
#include "SystemZMachineFunctionInfo.h"
#include "SystemZRegisterInfo.h"
#include "SystemZSubtarget.h"
#include "llvm/CodeGen/LivePhysRegs.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/RegisterScavenging.h"
#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
#include "llvm/IR/Function.h"
#include "llvm/Target/TargetMachine.h"
usingnamespacellvm;
namespace {
static const TargetFrameLowering::SpillSlot ELFSpillOffsetTable[] = …;
static const TargetFrameLowering::SpillSlot XPLINKSpillOffsetTable[] = …;
}
SystemZFrameLowering::SystemZFrameLowering(StackDirection D, Align StackAl,
int LAO, Align TransAl,
bool StackReal, unsigned PointerSize)
: … { … }
std::unique_ptr<SystemZFrameLowering>
SystemZFrameLowering::create(const SystemZSubtarget &STI) { … }
namespace {
struct SZFrameSortingObj { … };
SZFrameObjVec;
}
void SystemZELFFrameLowering::orderFrameObjects(
const MachineFunction &MF, SmallVectorImpl<int> &ObjectsToAllocate) const { … }
bool SystemZFrameLowering::hasReservedCallFrame(
const MachineFunction &MF) const { … }
bool SystemZELFFrameLowering::assignCalleeSavedSpillSlots(
MachineFunction &MF, const TargetRegisterInfo *TRI,
std::vector<CalleeSavedInfo> &CSI) const { … }
void SystemZELFFrameLowering::determineCalleeSaves(MachineFunction &MF,
BitVector &SavedRegs,
RegScavenger *RS) const { … }
SystemZELFFrameLowering::SystemZELFFrameLowering(unsigned PointerSize)
: … { … }
static void addSavedGPR(MachineBasicBlock &MBB, MachineInstrBuilder &MIB,
unsigned GPR64, bool IsImplicit) { … }
bool SystemZELFFrameLowering::spillCalleeSavedRegisters(
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
ArrayRef<CalleeSavedInfo> CSI, const TargetRegisterInfo *TRI) const { … }
bool SystemZELFFrameLowering::restoreCalleeSavedRegisters(
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
MutableArrayRef<CalleeSavedInfo> CSI, const TargetRegisterInfo *TRI) const { … }
void SystemZELFFrameLowering::processFunctionBeforeFrameFinalized(
MachineFunction &MF, RegScavenger *RS) const { … }
static void emitIncrement(MachineBasicBlock &MBB,
MachineBasicBlock::iterator &MBBI, const DebugLoc &DL,
Register Reg, int64_t NumBytes,
const TargetInstrInfo *TII) { … }
static void buildCFAOffs(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MBBI,
const DebugLoc &DL, int Offset,
const SystemZInstrInfo *ZII) { … }
static void buildDefCFAReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MBBI,
const DebugLoc &DL, unsigned Reg,
const SystemZInstrInfo *ZII) { … }
void SystemZELFFrameLowering::emitPrologue(MachineFunction &MF,
MachineBasicBlock &MBB) const { … }
void SystemZELFFrameLowering::emitEpilogue(MachineFunction &MF,
MachineBasicBlock &MBB) const { … }
void SystemZELFFrameLowering::inlineStackProbe(
MachineFunction &MF, MachineBasicBlock &PrologMBB) const { … }
bool SystemZELFFrameLowering::hasFP(const MachineFunction &MF) const { … }
StackOffset SystemZELFFrameLowering::getFrameIndexReference(
const MachineFunction &MF, int FI, Register &FrameReg) const { … }
unsigned SystemZELFFrameLowering::getRegSpillOffset(MachineFunction &MF,
Register Reg) const { … }
int SystemZELFFrameLowering::getOrCreateFramePointerSaveIndex(
MachineFunction &MF) const { … }
bool SystemZELFFrameLowering::usePackedStack(MachineFunction &MF) const { … }
SystemZXPLINKFrameLowering::SystemZXPLINKFrameLowering(unsigned PointerSize)
: … { … }
int SystemZXPLINKFrameLowering::getOrCreateFramePointerSaveIndex(
MachineFunction &MF) const { … }
static bool isXPLeafCandidate(const MachineFunction &MF) { … }
bool SystemZXPLINKFrameLowering::assignCalleeSavedSpillSlots(
MachineFunction &MF, const TargetRegisterInfo *TRI,
std::vector<CalleeSavedInfo> &CSI) const { … }
void SystemZXPLINKFrameLowering::determineCalleeSaves(MachineFunction &MF,
BitVector &SavedRegs,
RegScavenger *RS) const { … }
bool SystemZXPLINKFrameLowering::spillCalleeSavedRegisters(
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
ArrayRef<CalleeSavedInfo> CSI, const TargetRegisterInfo *TRI) const { … }
bool SystemZXPLINKFrameLowering::restoreCalleeSavedRegisters(
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
MutableArrayRef<CalleeSavedInfo> CSI, const TargetRegisterInfo *TRI) const { … }
void SystemZXPLINKFrameLowering::emitPrologue(MachineFunction &MF,
MachineBasicBlock &MBB) const { … }
void SystemZXPLINKFrameLowering::emitEpilogue(MachineFunction &MF,
MachineBasicBlock &MBB) const { … }
void SystemZXPLINKFrameLowering::inlineStackProbe(
MachineFunction &MF, MachineBasicBlock &PrologMBB) const { … }
bool SystemZXPLINKFrameLowering::hasFP(const MachineFunction &MF) const { … }
void SystemZXPLINKFrameLowering::processFunctionBeforeFrameFinalized(
MachineFunction &MF, RegScavenger *RS) const { … }
void SystemZXPLINKFrameLowering::determineFrameLayout(
MachineFunction &MF) const { … }