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 | // |
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 |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | /// \file |
Adrian Prantl | 5f8f34e4 | 2018-05-01 15:54:18 +0000 | [diff] [blame] | 10 | /// 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] | 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
Eugene Zelenko | 2bc2f33 | 2016-12-09 22:06:55 +0000 | [diff] [blame] | 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 | |
David Blaikie | 1be62f0 | 2017-11-03 22:32:11 +0000 | [diff] [blame] | 17 | #include "llvm/CodeGen/TargetFrameLowering.h" |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 18 | |
| 19 | namespace llvm { |
| 20 | |
Adrian Prantl | 5f8f34e4 | 2018-05-01 15:54:18 +0000 | [diff] [blame] | 21 | /// Information about the stack frame layout on the AMDGPU targets. |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 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: |
Guillaume Chatelet | 882c43d | 2019-10-17 07:49:39 +0000 | [diff] [blame^] | 28 | AMDGPUFrameLowering(StackDirection D, Align StackAl, int LAO, |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 29 | unsigned TransAl = 1); |
Eugene Zelenko | 2bc2f33 | 2016-12-09 22:06:55 +0000 | [diff] [blame] | 30 | ~AMDGPUFrameLowering() override; |
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; |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 35 | }; |
Eugene Zelenko | 2bc2f33 | 2016-12-09 22:06:55 +0000 | [diff] [blame] | 36 | |
| 37 | } // end namespace llvm |
| 38 | |
| 39 | #endif // LLVM_LIB_TARGET_AMDGPU_AMDGPUFRAMELOWERING_H |