LLVM  13.0.0git
LanaiFrameLowering.h
Go to the documentation of this file.
1 //===-- LanaiFrameLowering.h - Define frame lowering for Lanai --*- C++-*--===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This class implements Lanai-specific bits of TargetFrameLowering class.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_LIB_TARGET_LANAI_LANAIFRAMELOWERING_H
14 #define LLVM_LIB_TARGET_LANAI_LANAIFRAMELOWERING_H
15 
17 
18 namespace llvm {
19 
20 class BitVector;
21 class LanaiSubtarget;
22 
24 private:
25  void determineFrameLayout(MachineFunction &MF) const;
26  void replaceAdjDynAllocPseudo(MachineFunction &MF) const;
27 
28 protected:
30 
31 public:
32  explicit LanaiFrameLowering(const LanaiSubtarget &Subtarget)
34  /*StackAlignment=*/Align(8),
35  /*LocalAreaOffset=*/0),
36  STI(Subtarget) {}
37 
38  // emitProlog/emitEpilog - These methods insert prolog and epilog code into
39  // the function.
40  void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
41  void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
42 
45  MachineBasicBlock::iterator I) const override;
46 
47  bool hasFP(const MachineFunction & /*MF*/) const override { return true; }
48 
49  void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,
50  RegScavenger *RS = nullptr) const override;
51 };
52 
53 } // namespace llvm
54 
55 #endif // LLVM_LIB_TARGET_LANAI_LANAIFRAMELOWERING_H
llvm
Definition: AllocatorList.h:23
TargetFrameLowering.h
llvm::TargetFrameLowering
Information about stack frame layout on the target.
Definition: TargetFrameLowering.h:43
llvm::LanaiFrameLowering::eliminateCallFramePseudoInstr
MachineBasicBlock::iterator eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const override
This method is called during prolog/epilog code insertion to eliminate call frame setup and destroy p...
Definition: LanaiFrameLowering.cpp:141
llvm::LanaiFrameLowering::emitPrologue
void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override
emitProlog/emitEpilog - These methods insert prolog and epilog code into the function.
Definition: LanaiFrameLowering.cpp:91
llvm::LanaiFrameLowering::STI
const LanaiSubtarget & STI
Definition: LanaiFrameLowering.h:29
llvm::LanaiFrameLowering::hasFP
bool hasFP(const MachineFunction &) const override
hasFP - Return true if the specified function should have a dedicated frame pointer register.
Definition: LanaiFrameLowering.h:47
llvm::BitVector
Definition: BitVector.h:74
llvm::Align
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition: Alignment.h:39
llvm::MachineBasicBlock
Definition: MachineBasicBlock.h:95
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::RegScavenger
Definition: RegisterScavenging.h:34
llvm::MachineFunction
Definition: MachineFunction.h:230
llvm::LanaiSubtarget
Definition: LanaiSubtarget.h:29
MBB
MachineBasicBlock & MBB
Definition: AArch64SLSHardening.cpp:74
llvm::LanaiFrameLowering
Definition: LanaiFrameLowering.h:23
llvm::TargetFrameLowering::StackGrowsDown
@ StackGrowsDown
Definition: TargetFrameLowering.h:47
llvm::LanaiFrameLowering::LanaiFrameLowering
LanaiFrameLowering(const LanaiSubtarget &Subtarget)
Definition: LanaiFrameLowering.h:32
llvm::MachineInstrBundleIterator< MachineInstr >
llvm::LanaiFrameLowering::determineCalleeSaves
void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs, RegScavenger *RS=nullptr) const override
This method determines which of the registers reported by TargetRegisterInfo::getCalleeSavedRegs() sh...
Definition: LanaiFrameLowering.cpp:197
llvm::LanaiFrameLowering::emitEpilogue
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override
Definition: LanaiFrameLowering.cpp:178