Path: blob/main/contrib/llvm-project/llvm/lib/Target/VE/VEFrameLowering.h
35266 views
//===-- VEFrameLowering.h - Define frame lowering for VE --*- 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 VE-specific bits of TargetFrameLowering class.9//10//===----------------------------------------------------------------------===//1112#ifndef LLVM_LIB_TARGET_VE_VEFRAMELOWERING_H13#define LLVM_LIB_TARGET_VE_VEFRAMELOWERING_H1415#include "VE.h"16#include "llvm/CodeGen/TargetFrameLowering.h"17#include "llvm/Support/TypeSize.h"1819namespace llvm {2021class VESubtarget;22class VEFrameLowering : public TargetFrameLowering {23public:24explicit VEFrameLowering(const VESubtarget &ST);2526/// emitProlog/emitEpilog - These methods insert prolog and epilog code into27/// the function.28void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;29void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;30void emitPrologueInsns(MachineFunction &MF, MachineBasicBlock &MBB,31MachineBasicBlock::iterator MBBI, uint64_t NumBytes,32bool RequireFPUpdate) const;33void emitEpilogueInsns(MachineFunction &MF, MachineBasicBlock &MBB,34MachineBasicBlock::iterator MBBI, uint64_t NumBytes,35bool RequireFPUpdate) const;3637MachineBasicBlock::iterator38eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,39MachineBasicBlock::iterator I) const override;4041bool hasFP(const MachineFunction &MF) const override;42bool hasBP(const MachineFunction &MF) const;43bool hasGOT(const MachineFunction &MF) const;4445// VE reserves argument space always for call sites in the function46// immediately on entry of the current function.47bool hasReservedCallFrame(const MachineFunction &MF) const override {48return true;49}50void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,51RegScavenger *RS = nullptr) const override;5253StackOffset getFrameIndexReference(const MachineFunction &MF, int FI,54Register &FrameReg) const override;5556const SpillSlot *57getCalleeSavedSpillSlots(unsigned &NumEntries) const override {58static const SpillSlot Offsets[] = {59{VE::SX17, 40}, {VE::SX18, 48}, {VE::SX19, 56}, {VE::SX20, 64},60{VE::SX21, 72}, {VE::SX22, 80}, {VE::SX23, 88}, {VE::SX24, 96},61{VE::SX25, 104}, {VE::SX26, 112}, {VE::SX27, 120}, {VE::SX28, 128},62{VE::SX29, 136}, {VE::SX30, 144}, {VE::SX31, 152}, {VE::SX32, 160},63{VE::SX33, 168}};64NumEntries = std::size(Offsets);65return Offsets;66}6768protected:69const VESubtarget &STI;7071private:72// Returns true if MF is a leaf procedure.73bool isLeafProc(MachineFunction &MF) const;7475// Emits code for adjusting SP in function prologue/epilogue.76void emitSPAdjustment(MachineFunction &MF, MachineBasicBlock &MBB,77MachineBasicBlock::iterator MBBI, int64_t NumBytes,78MaybeAlign MayAlign = MaybeAlign()) const;7980// Emits code for extending SP in function prologue/epilogue.81void emitSPExtend(MachineFunction &MF, MachineBasicBlock &MBB,82MachineBasicBlock::iterator MBBI) const;83};8485} // namespace llvm8687#endif888990