blob: 91fe921bfeecd4d62324328736f7857108563e2d [file] [log] [blame]
Tom Stellardf3b2a1e2013-02-06 17:32:29 +00001//===--------------------- AMDGPUFrameLowering.h ----------------*- C++ -*-===//
Tom Stellard75aadc22012-12-11 21:25:42 +00002//
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 Arsenault0c90e952015-11-06 18:17:45 +000011/// \brief Interface to describe a layout of a stack frame on an AMDGPU target.
Tom Stellard75aadc22012-12-11 21:25:42 +000012//
13//===----------------------------------------------------------------------===//
Eugene Zelenko2bc2f332016-12-09 22:06:55 +000014
Matt Arsenault0c90e952015-11-06 18:17:45 +000015#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUFRAMELOWERING_H
16#define LLVM_LIB_TARGET_AMDGPU_AMDGPUFRAMELOWERING_H
Tom Stellard75aadc22012-12-11 21:25:42 +000017
David Blaikie1be62f02017-11-03 22:32:11 +000018#include "llvm/CodeGen/TargetFrameLowering.h"
Tom Stellard75aadc22012-12-11 21:25:42 +000019
20namespace llvm {
21
22/// \brief Information about the stack frame layout on the AMDGPU targets.
23///
24/// It holds the direction of the stack growth, the known stack alignment on
25/// entry to each function, and the offset to the locals area.
26/// See TargetFrameInfo for more comments.
27class AMDGPUFrameLowering : public TargetFrameLowering {
28public:
29 AMDGPUFrameLowering(StackDirection D, unsigned StackAl, int LAO,
30 unsigned TransAl = 1);
Eugene Zelenko2bc2f332016-12-09 22:06:55 +000031 ~AMDGPUFrameLowering() override;
Tom Stellardf3b2a1e2013-02-06 17:32:29 +000032
33 /// \returns The number of 32-bit sub-registers that are used when storing
34 /// values to the stack.
Craig Topperee7b0f32014-04-30 05:53:27 +000035 unsigned getStackWidth(const MachineFunction &MF) const;
Tom Stellard75aadc22012-12-11 21:25:42 +000036};
Eugene Zelenko2bc2f332016-12-09 22:06:55 +000037
38} // end namespace llvm
39
40#endif // LLVM_LIB_TARGET_AMDGPU_AMDGPUFRAMELOWERING_H