Path: blob/main/contrib/llvm-project/llvm/lib/Target/CSKY/CSKYFrameLowering.h
35294 views
//===-- CSKYFrameLowering.h - Define frame lowering for CSKY -*- C++ -*--===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This class implements CSKY-specific bits of TargetFrameLowering class.9//10//===----------------------------------------------------------------------===//1112#ifndef LLVM_LIB_TARGET_CSKY_CSKYFRAMELOWERING_H13#define LLVM_LIB_TARGET_CSKY_CSKYFRAMELOWERING_H1415#include "llvm/CodeGen/TargetFrameLowering.h"1617namespace llvm {18class CSKYSubtarget;1920class CSKYFrameLowering : public TargetFrameLowering {21const CSKYSubtarget &STI;2223void determineFrameLayout(MachineFunction &MF) const;24void adjustReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,25const DebugLoc &DL, Register DestReg, Register SrcReg,26int64_t Val, MachineInstr::MIFlag Flag) const;2728public:29explicit CSKYFrameLowering(const CSKYSubtarget &STI)30: TargetFrameLowering(StackGrowsDown,31/*StackAlignment=*/Align(4),32/*LocalAreaOffset=*/0),33STI(STI) {}3435void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;36void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;3738StackOffset getFrameIndexReference(const MachineFunction &MF, int FI,39Register &FrameReg) const override;4041void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,42RegScavenger *RS) const override;4344bool assignCalleeSavedSpillSlots(45MachineFunction &MF, const TargetRegisterInfo *TRI,46std::vector<CalleeSavedInfo> &CSI) const override {4748std::reverse(CSI.begin(), CSI.end());4950return false;51}5253bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,54MachineBasicBlock::iterator MI,55ArrayRef<CalleeSavedInfo> CSI,56const TargetRegisterInfo *TRI) const override;57bool58restoreCalleeSavedRegisters(MachineBasicBlock &MBB,59MachineBasicBlock::iterator MI,60MutableArrayRef<CalleeSavedInfo> CSI,61const TargetRegisterInfo *TRI) const override;6263bool hasFP(const MachineFunction &MF) const override;64bool hasBP(const MachineFunction &MF) const;6566bool hasReservedCallFrame(const MachineFunction &MF) const override;6768MachineBasicBlock::iterator69eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,70MachineBasicBlock::iterator MI) const override;71};72} // namespace llvm73#endif747576