Jia Liu | f54f60f | 2012-02-28 07:46:26 +0000 | [diff] [blame] | 1 | //===-- MipsFrameLowering.h - Define frame lowering for Mips ----*- C++ -*-===// |
Anton Korobeynikov | f7183ed | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
Akira Hatanaka | e248912 | 2011-04-15 21:51:11 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
Anton Korobeynikov | f7183ed | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 9 | // |
| 10 | // |
| 11 | // |
Akira Hatanaka | e248912 | 2011-04-15 21:51:11 +0000 | [diff] [blame] | 12 | //===----------------------------------------------------------------------===// |
Anton Korobeynikov | f7183ed | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 13 | |
Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 14 | #ifndef LLVM_LIB_TARGET_MIPS_MIPSFRAMELOWERING_H |
| 15 | #define LLVM_LIB_TARGET_MIPS_MIPSFRAMELOWERING_H |
Anton Korobeynikov | f7183ed | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 16 | |
| 17 | #include "Mips.h" |
Anton Korobeynikov | 2f93128 | 2011-01-10 12:39:04 +0000 | [diff] [blame] | 18 | #include "llvm/Target/TargetFrameLowering.h" |
Anton Korobeynikov | f7183ed | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 19 | |
| 20 | namespace llvm { |
| 21 | class MipsSubtarget; |
| 22 | |
Anton Korobeynikov | 2f93128 | 2011-01-10 12:39:04 +0000 | [diff] [blame] | 23 | class MipsFrameLowering : public TargetFrameLowering { |
Anton Korobeynikov | f7183ed | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 24 | protected: |
| 25 | const MipsSubtarget &STI; |
| 26 | |
| 27 | public: |
Akira Hatanaka | 11184e4 | 2013-03-29 01:51:04 +0000 | [diff] [blame] | 28 | explicit MipsFrameLowering(const MipsSubtarget &sti, unsigned Alignment) |
| 29 | : TargetFrameLowering(StackGrowsDown, Alignment, 0, Alignment), STI(sti) {} |
Anton Korobeynikov | f7183ed | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 30 | |
Eric Christopher | e54f10e | 2014-07-18 23:33:47 +0000 | [diff] [blame] | 31 | static const MipsFrameLowering *create(const MipsSubtarget &ST); |
Akira Hatanaka | fab8929 | 2012-08-02 18:21:47 +0000 | [diff] [blame] | 32 | |
Craig Topper | 56c590a | 2014-04-29 07:58:02 +0000 | [diff] [blame] | 33 | bool hasFP(const MachineFunction &MF) const override; |
Akira Hatanaka | 97b43d8b | 2012-11-02 21:10:22 +0000 | [diff] [blame] | 34 | |
Vasileios Kalintiris | bb698c7 | 2015-06-02 13:14:46 +0000 | [diff] [blame] | 35 | bool hasBP(const MachineFunction &MF) const; |
| 36 | |
Petar Jovanovic | e0de8f4 | 2015-05-12 17:14:05 +0000 | [diff] [blame] | 37 | bool isFPCloseToIncomingSP() const override { return false; } |
| 38 | |
Hans Wennborg | e1a2e90 | 2016-03-31 18:33:38 +0000 | [diff] [blame] | 39 | MachineBasicBlock::iterator |
Vasileios Kalintiris | 580f067 | 2015-04-02 11:09:40 +0000 | [diff] [blame] | 40 | eliminateCallFramePseudoInstr(MachineFunction &MF, |
| 41 | MachineBasicBlock &MBB, |
| 42 | MachineBasicBlock::iterator I) const override; |
| 43 | |
Akira Hatanaka | 97b43d8b | 2012-11-02 21:10:22 +0000 | [diff] [blame] | 44 | protected: |
| 45 | uint64_t estimateStackSize(const MachineFunction &MF) const; |
Anton Korobeynikov | f7183ed | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 46 | }; |
| 47 | |
Akira Hatanaka | 0bb60d89 | 2013-03-12 00:16:36 +0000 | [diff] [blame] | 48 | /// Create MipsFrameLowering objects. |
Akira Hatanaka | fab8929 | 2012-08-02 18:21:47 +0000 | [diff] [blame] | 49 | const MipsFrameLowering *createMips16FrameLowering(const MipsSubtarget &ST); |
| 50 | const MipsFrameLowering *createMipsSEFrameLowering(const MipsSubtarget &ST); |
| 51 | |
Alexander Kornienko | f00654e | 2015-06-23 09:49:53 +0000 | [diff] [blame] | 52 | } // End llvm namespace |
Anton Korobeynikov | f7183ed | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 53 | |
| 54 | #endif |