LLVM 20.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
19namespace llvm {
20 class MipsSubtarget;
21
23protected:
25
26public:
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
38 const MachineFunction &MF) const override {
39 return false;
40 }
41
42 bool enableShrinkWrapping(const MachineFunction &MF) const override {
43 return true;
44 }
45
49 MachineBasicBlock::iterator I) const override;
50
51protected:
53};
54
55/// Create MipsFrameLowering objects.
56const MipsFrameLowering *createMips16FrameLowering(const MipsSubtarget &ST);
57const MipsFrameLowering *createMipsSEFrameLowering(const MipsSubtarget &ST);
58
59} // End llvm namespace
60
61#endif
MachineBasicBlock & MBB
#define I(x, y, z)
Definition: MD5.cpp:58
static const MipsFrameLowering * create(const MipsSubtarget &ST)
bool hasFP(const MachineFunction &MF) const override
hasFP - Return true if the specified function should have a dedicated frame pointer register.
bool allocateScavengingFrameIndexesNearIncomingSP(const MachineFunction &MF) const override
Control the placement of special register scavenging spill slots when allocating a stack frame.
MipsFrameLowering(const MipsSubtarget &sti, Align Alignment)
bool hasBP(const MachineFunction &MF) const
uint64_t estimateStackSize(const MachineFunction &MF) const
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...
bool enableShrinkWrapping(const MachineFunction &MF) const override
Returns true if the target will correctly handle shrink wrapping.
const MipsSubtarget & STI
Information about stack frame layout on the target.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
const MipsFrameLowering * createMipsSEFrameLowering(const MipsSubtarget &ST)
const MipsFrameLowering * createMips16FrameLowering(const MipsSubtarget &ST)
Create MipsFrameLowering objects.
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition: Alignment.h:39