Tom Stellard | f3b2a1e | 2013-02-06 17:32:29 +0000 | [diff] [blame] | 1 | //===--------------------- AMDGPUFrameLowering.h ----------------*- C++ -*-===// |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +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 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | /// \file |
Matt Arsenault | 0c90e95 | 2015-11-06 18:17:45 +0000 | [diff] [blame] | 11 | /// \brief Interface to describe a layout of a stack frame on an AMDGPU target. |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
Matt Arsenault | 0c90e95 | 2015-11-06 18:17:45 +0000 | [diff] [blame] | 14 | #ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUFRAMELOWERING_H |
| 15 | #define LLVM_LIB_TARGET_AMDGPU_AMDGPUFRAMELOWERING_H |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 16 | |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 17 | #include "llvm/Target/TargetFrameLowering.h" |
| 18 | |
| 19 | namespace llvm { |
| 20 | |
| 21 | /// \brief Information about the stack frame layout on the AMDGPU targets. |
| 22 | /// |
| 23 | /// It holds the direction of the stack growth, the known stack alignment on |
| 24 | /// entry to each function, and the offset to the locals area. |
| 25 | /// See TargetFrameInfo for more comments. |
| 26 | class AMDGPUFrameLowering : public TargetFrameLowering { |
| 27 | public: |
| 28 | AMDGPUFrameLowering(StackDirection D, unsigned StackAl, int LAO, |
| 29 | unsigned TransAl = 1); |
| 30 | virtual ~AMDGPUFrameLowering(); |
Tom Stellard | f3b2a1e | 2013-02-06 17:32:29 +0000 | [diff] [blame] | 31 | |
| 32 | /// \returns The number of 32-bit sub-registers that are used when storing |
| 33 | /// values to the stack. |
Craig Topper | ee7b0f3 | 2014-04-30 05:53:27 +0000 | [diff] [blame] | 34 | unsigned getStackWidth(const MachineFunction &MF) const; |
Matt Arsenault | 43e92fe | 2016-06-24 06:30:11 +0000 | [diff] [blame] | 35 | |
James Y Knight | 5567baf | 2015-08-15 02:32:35 +0000 | [diff] [blame] | 36 | int getFrameIndexReference(const MachineFunction &MF, int FI, |
| 37 | unsigned &FrameReg) const override; |
Matt Arsenault | 43e92fe | 2016-06-24 06:30:11 +0000 | [diff] [blame] | 38 | |
Matt Arsenault | 43e92fe | 2016-06-24 06:30:11 +0000 | [diff] [blame] | 39 | bool hasFP(const MachineFunction &MF) const override { |
| 40 | return false; |
| 41 | } |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 42 | }; |
| 43 | } // namespace llvm |
Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 44 | #endif |