2012-02-28 15:46:26 +08:00
|
|
|
//===-- MipsFrameLowering.h - Define frame lowering for Mips ----*- C++ -*-===//
|
2010-11-15 08:06:54 +08:00
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2010-11-15 08:06:54 +08:00
|
|
|
//
|
2011-04-16 05:51:11 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2010-11-15 08:06:54 +08:00
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
2011-04-16 05:51:11 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2010-11-15 08:06:54 +08:00
|
|
|
|
2014-08-14 00:26:38 +08:00
|
|
|
#ifndef LLVM_LIB_TARGET_MIPS_MIPSFRAMELOWERING_H
|
|
|
|
#define LLVM_LIB_TARGET_MIPS_MIPSFRAMELOWERING_H
|
2010-11-15 08:06:54 +08:00
|
|
|
|
|
|
|
#include "Mips.h"
|
2017-11-04 06:32:11 +08:00
|
|
|
#include "llvm/CodeGen/TargetFrameLowering.h"
|
2010-11-15 08:06:54 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
class MipsSubtarget;
|
|
|
|
|
2011-01-10 20:39:04 +08:00
|
|
|
class MipsFrameLowering : public TargetFrameLowering {
|
2010-11-15 08:06:54 +08:00
|
|
|
protected:
|
|
|
|
const MipsSubtarget &STI;
|
|
|
|
|
|
|
|
public:
|
2013-03-29 09:51:04 +08:00
|
|
|
explicit MipsFrameLowering(const MipsSubtarget &sti, unsigned Alignment)
|
|
|
|
: TargetFrameLowering(StackGrowsDown, Alignment, 0, Alignment), STI(sti) {}
|
2010-11-15 08:06:54 +08:00
|
|
|
|
2014-07-19 07:33:47 +08:00
|
|
|
static const MipsFrameLowering *create(const MipsSubtarget &ST);
|
2012-08-03 02:21:47 +08:00
|
|
|
|
2014-04-29 15:58:02 +08:00
|
|
|
bool hasFP(const MachineFunction &MF) const override;
|
2012-11-03 05:10:22 +08:00
|
|
|
|
2015-06-02 21:14:46 +08:00
|
|
|
bool hasBP(const MachineFunction &MF) const;
|
|
|
|
|
2015-05-13 01:14:05 +08:00
|
|
|
bool isFPCloseToIncomingSP() const override { return false; }
|
|
|
|
|
2018-06-30 00:37:16 +08:00
|
|
|
bool enableShrinkWrapping(const MachineFunction &MF) const override {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-04-01 02:33:38 +08:00
|
|
|
MachineBasicBlock::iterator
|
2015-04-02 19:09:40 +08:00
|
|
|
eliminateCallFramePseudoInstr(MachineFunction &MF,
|
|
|
|
MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator I) const override;
|
|
|
|
|
2012-11-03 05:10:22 +08:00
|
|
|
protected:
|
|
|
|
uint64_t estimateStackSize(const MachineFunction &MF) const;
|
2010-11-15 08:06:54 +08:00
|
|
|
};
|
|
|
|
|
2013-03-12 08:16:36 +08:00
|
|
|
/// Create MipsFrameLowering objects.
|
2012-08-03 02:21:47 +08:00
|
|
|
const MipsFrameLowering *createMips16FrameLowering(const MipsSubtarget &ST);
|
|
|
|
const MipsFrameLowering *createMipsSEFrameLowering(const MipsSubtarget &ST);
|
|
|
|
|
2015-06-23 17:49:53 +08:00
|
|
|
} // End llvm namespace
|
2010-11-15 08:06:54 +08:00
|
|
|
|
|
|
|
#endif
|