mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-24 06:30:19 +00:00
7b837d8c75
This adds a second implementation of the AArch64 architecture to LLVM, accessible in parallel via the "arm64" triple. The plan over the coming weeks & months is to merge the two into a single backend, during which time thorough code review should naturally occur. Everything will be easier with the target in-tree though, hence this commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205090 91177308-0d34-0410-b5e6-96231b3b80d8
76 lines
2.8 KiB
C++
76 lines
2.8 KiB
C++
//===-- ARM64FrameLowering.h - TargetFrameLowering for ARM64 ----*- C++ -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
//
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef ARM64_FRAMELOWERING_H
|
|
#define ARM64_FRAMELOWERING_H
|
|
|
|
#include "llvm/Target/TargetFrameLowering.h"
|
|
|
|
namespace llvm {
|
|
|
|
class ARM64Subtarget;
|
|
class ARM64TargetMachine;
|
|
|
|
class ARM64FrameLowering : public TargetFrameLowering {
|
|
const ARM64TargetMachine &TM;
|
|
|
|
public:
|
|
explicit ARM64FrameLowering(const ARM64TargetMachine &TM,
|
|
const ARM64Subtarget &STI)
|
|
: TargetFrameLowering(StackGrowsDown, 16, 0, 16,
|
|
false /*StackRealignable*/),
|
|
TM(TM) {}
|
|
|
|
void emitCalleeSavedFrameMoves(MachineBasicBlock &MBB,
|
|
MachineBasicBlock::iterator MBBI,
|
|
unsigned FramePtr) const;
|
|
|
|
void eliminateCallFramePseudoInstr(MachineFunction &MF,
|
|
MachineBasicBlock &MBB,
|
|
MachineBasicBlock::iterator I) const;
|
|
|
|
/// emitProlog/emitEpilog - These methods insert prolog and epilog code into
|
|
/// the function.
|
|
void emitPrologue(MachineFunction &MF) const;
|
|
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
|
|
|
|
int getFrameIndexOffset(const MachineFunction &MF, int FI) const;
|
|
int getFrameIndexReference(const MachineFunction &MF, int FI,
|
|
unsigned &FrameReg) const;
|
|
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,
|
|
const TargetRegisterInfo *TRI) const;
|
|
|
|
bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
|
|
MachineBasicBlock::iterator MI,
|
|
const std::vector<CalleeSavedInfo> &CSI,
|
|
const TargetRegisterInfo *TRI) const;
|
|
|
|
/// \brief Can this function use the red zone for local allocations.
|
|
bool canUseRedZone(const MachineFunction &MF) const;
|
|
|
|
bool hasFP(const MachineFunction &MF) const;
|
|
bool hasReservedCallFrame(const MachineFunction &MF) const;
|
|
|
|
void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
|
|
RegScavenger *RS) const;
|
|
};
|
|
|
|
} // End llvm namespace
|
|
|
|
#endif
|