2014-05-24 20:50:23 +08:00
|
|
|
//==-- AArch64FrameLowering.h - TargetFrameLowering for AArch64 --*- C++ -*-==//
|
2014-03-29 18:18:08 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-14 00:26:38 +08:00
|
|
|
#ifndef LLVM_LIB_TARGET_AARCH64_AARCH64FRAMELOWERING_H
|
|
|
|
#define LLVM_LIB_TARGET_AARCH64_AARCH64FRAMELOWERING_H
|
2014-03-29 18:18:08 +08:00
|
|
|
|
|
|
|
#include "llvm/Target/TargetFrameLowering.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2014-05-24 20:50:23 +08:00
|
|
|
class AArch64FrameLowering : public TargetFrameLowering {
|
2014-03-29 18:18:08 +08:00
|
|
|
public:
|
2014-06-11 01:33:39 +08:00
|
|
|
explicit AArch64FrameLowering()
|
2014-03-29 18:18:08 +08:00
|
|
|
: TargetFrameLowering(StackGrowsDown, 16, 0, 16,
|
2014-06-11 01:33:39 +08:00
|
|
|
false /*StackRealignable*/) {}
|
2014-03-29 18:18:08 +08:00
|
|
|
|
|
|
|
void emitCalleeSavedFrameMoves(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator MBBI,
|
|
|
|
unsigned FramePtr) const;
|
|
|
|
|
|
|
|
void eliminateCallFramePseudoInstr(MachineFunction &MF,
|
2014-04-29 15:58:25 +08:00
|
|
|
MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator I) const override;
|
2014-03-29 18:18:08 +08:00
|
|
|
|
|
|
|
/// emitProlog/emitEpilog - These methods insert prolog and epilog code into
|
|
|
|
/// the function.
|
2014-04-29 15:58:25 +08:00
|
|
|
void emitPrologue(MachineFunction &MF) const override;
|
|
|
|
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
|
2014-03-29 18:18:08 +08:00
|
|
|
|
2014-04-29 15:58:25 +08:00
|
|
|
int getFrameIndexOffset(const MachineFunction &MF, int FI) const override;
|
2014-03-29 18:18:08 +08:00
|
|
|
int getFrameIndexReference(const MachineFunction &MF, int FI,
|
2014-04-29 15:58:25 +08:00
|
|
|
unsigned &FrameReg) const override;
|
2014-03-29 18:18:08 +08:00
|
|
|
int resolveFrameIndexReference(const MachineFunction &MF, int FI,
|
|
|
|
unsigned &FrameReg,
|
|
|
|
bool PreferFP = false) const;
|
|
|
|
bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator MI,
|
|
|
|
const std::vector<CalleeSavedInfo> &CSI,
|
2014-04-29 15:58:25 +08:00
|
|
|
const TargetRegisterInfo *TRI) const override;
|
2014-03-29 18:18:08 +08:00
|
|
|
|
|
|
|
bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
|
2014-04-29 15:58:25 +08:00
|
|
|
MachineBasicBlock::iterator MI,
|
|
|
|
const std::vector<CalleeSavedInfo> &CSI,
|
|
|
|
const TargetRegisterInfo *TRI) const override;
|
2014-03-29 18:18:08 +08:00
|
|
|
|
|
|
|
/// \brief Can this function use the red zone for local allocations.
|
|
|
|
bool canUseRedZone(const MachineFunction &MF) const;
|
|
|
|
|
2014-04-29 15:58:25 +08:00
|
|
|
bool hasFP(const MachineFunction &MF) const override;
|
|
|
|
bool hasReservedCallFrame(const MachineFunction &MF) const override;
|
2014-03-29 18:18:08 +08:00
|
|
|
|
|
|
|
void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
|
2014-04-29 15:58:25 +08:00
|
|
|
RegScavenger *RS) const override;
|
2014-03-29 18:18:08 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End llvm namespace
|
|
|
|
|
|
|
|
#endif
|