| 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 | // | 
| Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 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 | 
| Anton Korobeynikov | f7183ed | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 6 | // | 
| Akira Hatanaka | e248912 | 2011-04-15 21:51:11 +0000 | [diff] [blame] | 7 | //===----------------------------------------------------------------------===// | 
| Anton Korobeynikov | f7183ed | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 8 | // | 
|  | 9 | // | 
|  | 10 | // | 
| Akira Hatanaka | e248912 | 2011-04-15 21:51:11 +0000 | [diff] [blame] | 11 | //===----------------------------------------------------------------------===// | 
| Anton Korobeynikov | f7183ed | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 12 |  | 
| Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 13 | #ifndef LLVM_LIB_TARGET_MIPS_MIPSFRAMELOWERING_H | 
|  | 14 | #define LLVM_LIB_TARGET_MIPS_MIPSFRAMELOWERING_H | 
| Anton Korobeynikov | f7183ed | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 15 |  | 
|  | 16 | #include "Mips.h" | 
| David Blaikie | 1be62f0 | 2017-11-03 22:32:11 +0000 | [diff] [blame] | 17 | #include "llvm/CodeGen/TargetFrameLowering.h" | 
| Anton Korobeynikov | f7183ed | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 18 |  | 
|  | 19 | namespace llvm { | 
|  | 20 | class MipsSubtarget; | 
|  | 21 |  | 
| Anton Korobeynikov | 2f93128 | 2011-01-10 12:39:04 +0000 | [diff] [blame] | 22 | class MipsFrameLowering : public TargetFrameLowering { | 
| Anton Korobeynikov | f7183ed | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 23 | protected: | 
|  | 24 | const MipsSubtarget &STI; | 
|  | 25 |  | 
|  | 26 | public: | 
| Akira Hatanaka | 11184e4 | 2013-03-29 01:51:04 +0000 | [diff] [blame] | 27 | explicit MipsFrameLowering(const MipsSubtarget &sti, unsigned Alignment) | 
|  | 28 | : TargetFrameLowering(StackGrowsDown, Alignment, 0, Alignment), STI(sti) {} | 
| Anton Korobeynikov | f7183ed | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 29 |  | 
| Eric Christopher | e54f10e | 2014-07-18 23:33:47 +0000 | [diff] [blame] | 30 | static const MipsFrameLowering *create(const MipsSubtarget &ST); | 
| Akira Hatanaka | fab8929 | 2012-08-02 18:21:47 +0000 | [diff] [blame] | 31 |  | 
| Craig Topper | 56c590a | 2014-04-29 07:58:02 +0000 | [diff] [blame] | 32 | bool hasFP(const MachineFunction &MF) const override; | 
| Akira Hatanaka | 97b43d8b | 2012-11-02 21:10:22 +0000 | [diff] [blame] | 33 |  | 
| Vasileios Kalintiris | bb698c7 | 2015-06-02 13:14:46 +0000 | [diff] [blame] | 34 | bool hasBP(const MachineFunction &MF) const; | 
|  | 35 |  | 
| Petar Jovanovic | e0de8f4 | 2015-05-12 17:14:05 +0000 | [diff] [blame] | 36 | bool isFPCloseToIncomingSP() const override { return false; } | 
|  | 37 |  | 
| Petar Jovanovic | cccc236 | 2018-06-29 16:37:16 +0000 | [diff] [blame] | 38 | bool enableShrinkWrapping(const MachineFunction &MF) const override { | 
|  | 39 | return true; | 
|  | 40 | } | 
|  | 41 |  | 
| Hans Wennborg | e1a2e90 | 2016-03-31 18:33:38 +0000 | [diff] [blame] | 42 | MachineBasicBlock::iterator | 
| Vasileios Kalintiris | 580f067 | 2015-04-02 11:09:40 +0000 | [diff] [blame] | 43 | eliminateCallFramePseudoInstr(MachineFunction &MF, | 
|  | 44 | MachineBasicBlock &MBB, | 
|  | 45 | MachineBasicBlock::iterator I) const override; | 
|  | 46 |  | 
| Akira Hatanaka | 97b43d8b | 2012-11-02 21:10:22 +0000 | [diff] [blame] | 47 | protected: | 
|  | 48 | uint64_t estimateStackSize(const MachineFunction &MF) const; | 
| Anton Korobeynikov | f7183ed | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 49 | }; | 
|  | 50 |  | 
| Akira Hatanaka | 0bb60d89 | 2013-03-12 00:16:36 +0000 | [diff] [blame] | 51 | /// Create MipsFrameLowering objects. | 
| Akira Hatanaka | fab8929 | 2012-08-02 18:21:47 +0000 | [diff] [blame] | 52 | const MipsFrameLowering *createMips16FrameLowering(const MipsSubtarget &ST); | 
|  | 53 | const MipsFrameLowering *createMipsSEFrameLowering(const MipsSubtarget &ST); | 
|  | 54 |  | 
| Alexander Kornienko | f00654e | 2015-06-23 09:49:53 +0000 | [diff] [blame] | 55 | } // End llvm namespace | 
| Anton Korobeynikov | f7183ed | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 56 |  | 
|  | 57 | #endif |