LLVM  9.0.0svn
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 
16 #include "Lanai.h"
18 
19 namespace llvm {
20 
21 class BitVector;
22 class LanaiSubtarget;
23 
25 private:
26  void determineFrameLayout(MachineFunction &MF) const;
27  void replaceAdjDynAllocPseudo(MachineFunction &MF) const;
28 
29 protected:
31 
32 public:
33  explicit LanaiFrameLowering(const LanaiSubtarget &Subtarget)
35  /*StackAlignment=*/8,
36  /*LocalAreaOffset=*/0),
37  STI(Subtarget) {}
38 
39  // emitProlog/emitEpilog - These methods insert prolog and epilog code into
40  // the function.
41  void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
42  void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
43 
46  MachineBasicBlock::iterator I) const override;
47 
48  bool hasFP(const MachineFunction & /*MF*/) const override { return true; }
49 
50  void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,
51  RegScavenger *RS = nullptr) const override;
52 };
53 
54 } // namespace llvm
55 
56 #endif // LLVM_LIB_TARGET_LANAI_LANAIFRAMELOWERING_H
void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs, RegScavenger *RS=nullptr) const override
This method determines which of the registers reported by TargetRegisterInfo::getCalleeSavedRegs() sh...
This class represents lattice values for constants.
Definition: AllocatorList.h:23
bool hasFP(const MachineFunction &) const override
hasFP - Return true if the specified function should have a dedicated frame pointer register...
void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override
emitProlog/emitEpilog - These methods insert prolog and epilog code into the function.
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...
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override
const LanaiSubtarget & STI
Information about stack frame layout on the target.
LanaiFrameLowering(const LanaiSubtarget &Subtarget)
#define I(x, y, z)
Definition: MD5.cpp:58