1 //===-- MipsFrameLowering.h - Define frame lowering for Mips ----*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_LIB_TARGET_MIPS_MIPSFRAMELOWERING_H
14 #define LLVM_LIB_TARGET_MIPS_MIPSFRAMELOWERING_H
17 #include "llvm/CodeGen/TargetFrameLowering.h"
22 class MipsFrameLowering
: public TargetFrameLowering
{
24 const MipsSubtarget
&STI
;
27 explicit MipsFrameLowering(const MipsSubtarget
&sti
, Align Alignment
)
28 : TargetFrameLowering(StackGrowsDown
, Alignment
, 0, Alignment
), STI(sti
) {
31 static const MipsFrameLowering
*create(const MipsSubtarget
&ST
);
33 bool hasFP(const MachineFunction
&MF
) const override
;
35 bool hasBP(const MachineFunction
&MF
) const;
37 bool allocateScavengingFrameIndexesNearIncomingSP(
38 const MachineFunction
&MF
) const override
{
42 bool enableShrinkWrapping(const MachineFunction
&MF
) const override
{
46 MachineBasicBlock::iterator
47 eliminateCallFramePseudoInstr(MachineFunction
&MF
,
48 MachineBasicBlock
&MBB
,
49 MachineBasicBlock::iterator I
) const override
;
52 uint64_t estimateStackSize(const MachineFunction
&MF
) const;
55 /// Create MipsFrameLowering objects.
56 const MipsFrameLowering
*createMips16FrameLowering(const MipsSubtarget
&ST
);
57 const MipsFrameLowering
*createMipsSEFrameLowering(const MipsSubtarget
&ST
);
59 } // End llvm namespace