LLVM  13.0.0git
MipsFrameLowering.h
Go to the documentation of this file.
1 //===-- MipsFrameLowering.h - Define frame lowering for Mips ----*- 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 //
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_LIB_TARGET_MIPS_MIPSFRAMELOWERING_H
14 #define LLVM_LIB_TARGET_MIPS_MIPSFRAMELOWERING_H
15 
16 #include "Mips.h"
18 
19 namespace llvm {
20  class MipsSubtarget;
21 
23 protected:
25 
26 public:
27  explicit MipsFrameLowering(const MipsSubtarget &sti, Align Alignment)
28  : TargetFrameLowering(StackGrowsDown, Alignment, 0, Alignment), STI(sti) {
29  }
30 
31  static const MipsFrameLowering *create(const MipsSubtarget &ST);
32 
33  bool hasFP(const MachineFunction &MF) const override;
34 
35  bool hasBP(const MachineFunction &MF) const;
36 
37  bool isFPCloseToIncomingSP() const override { return false; }
38 
39  bool enableShrinkWrapping(const MachineFunction &MF) const override {
40  return true;
41  }
42 
46  MachineBasicBlock::iterator I) const override;
47 
48 protected:
49  uint64_t estimateStackSize(const MachineFunction &MF) const;
50 };
51 
52 /// Create MipsFrameLowering objects.
53 const MipsFrameLowering *createMips16FrameLowering(const MipsSubtarget &ST);
54 const MipsFrameLowering *createMipsSEFrameLowering(const MipsSubtarget &ST);
55 
56 } // End llvm namespace
57 
58 #endif
llvm
Definition: AllocatorList.h:23
TargetFrameLowering.h
llvm::TargetFrameLowering
Information about stack frame layout on the target.
Definition: TargetFrameLowering.h:42
llvm::MipsFrameLowering::MipsFrameLowering
MipsFrameLowering(const MipsSubtarget &sti, Align Alignment)
Definition: MipsFrameLowering.h:27
llvm::MipsFrameLowering::create
static const MipsFrameLowering * create(const MipsSubtarget &ST)
Definition: MipsFrameLowering.cpp:82
llvm::createMipsSEFrameLowering
const MipsFrameLowering * createMipsSEFrameLowering(const MipsSubtarget &ST)
Definition: MipsSEFrameLowering.cpp:918
Mips.h
llvm::MipsFrameLowering::estimateStackSize
uint64_t estimateStackSize(const MachineFunction &MF) const
Definition: MipsFrameLowering.cpp:114
llvm::MipsFrameLowering::isFPCloseToIncomingSP
bool isFPCloseToIncomingSP() const override
isFPCloseToIncomingSP - Return true if the frame pointer is close to the incoming stack pointer,...
Definition: MipsFrameLowering.h:37
llvm::MipsFrameLowering::STI
const MipsSubtarget & STI
Definition: MipsFrameLowering.h:24
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
llvm::MipsFrameLowering::enableShrinkWrapping
bool enableShrinkWrapping(const MachineFunction &MF) const override
Returns true if the target will correctly handle shrink wrapping.
Definition: MipsFrameLowering.h:39
llvm::ARM_MB::ST
@ ST
Definition: ARMBaseInfo.h:73
llvm::MipsFrameLowering::hasFP
bool hasFP(const MachineFunction &MF) const override
hasFP - Return true if the specified function should have a dedicated frame pointer register.
Definition: MipsFrameLowering.cpp:93
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::MipsFrameLowering::hasBP
bool hasBP(const MachineFunction &MF) const
Definition: MipsFrameLowering.cpp:102
llvm::createMips16FrameLowering
const MipsFrameLowering * createMips16FrameLowering(const MipsSubtarget &ST)
Create MipsFrameLowering objects.
Definition: Mips16FrameLowering.cpp:175
llvm::MachineFunction
Definition: MachineFunction.h:230
llvm::MipsFrameLowering
Definition: MipsFrameLowering.h:22
llvm::MipsSubtarget
Definition: MipsSubtarget.h:39
MBB
MachineBasicBlock & MBB
Definition: AArch64SLSHardening.cpp:74
llvm::TargetFrameLowering::StackGrowsDown
@ StackGrowsDown
Definition: TargetFrameLowering.h:46
llvm::MachineInstrBundleIterator< MachineInstr >
llvm::MipsFrameLowering::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: MipsFrameLowering.cpp:138