blob: 090e2bc302cc7dd48f98a8419a0162e95bbed98e [file] [log] [blame]
Tom Stellardf3b2a1e2013-02-06 17:32:29 +00001//===--------------------- AMDGPUFrameLowering.h ----------------*- C++ -*-===//
Tom Stellard75aadc22012-12-11 21:25:42 +00002//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// 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 Stellard75aadc22012-12-11 21:25:42 +00006//
7//===----------------------------------------------------------------------===//
8//
9/// \file
Adrian Prantl5f8f34e42018-05-01 15:54:18 +000010/// Interface to describe a layout of a stack frame on an AMDGPU target.
Tom Stellard75aadc22012-12-11 21:25:42 +000011//
12//===----------------------------------------------------------------------===//
Eugene Zelenko2bc2f332016-12-09 22:06:55 +000013
Matt Arsenault0c90e952015-11-06 18:17:45 +000014#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUFRAMELOWERING_H
15#define LLVM_LIB_TARGET_AMDGPU_AMDGPUFRAMELOWERING_H
Tom Stellard75aadc22012-12-11 21:25:42 +000016
David Blaikie1be62f02017-11-03 22:32:11 +000017#include "llvm/CodeGen/TargetFrameLowering.h"
Tom Stellard75aadc22012-12-11 21:25:42 +000018
19namespace llvm {
20
Adrian Prantl5f8f34e42018-05-01 15:54:18 +000021/// Information about the stack frame layout on the AMDGPU targets.
Tom Stellard75aadc22012-12-11 21:25:42 +000022///
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.
26class AMDGPUFrameLowering : public TargetFrameLowering {
27public:
Guillaume Chatelet882c43d2019-10-17 07:49:39 +000028 AMDGPUFrameLowering(StackDirection D, Align StackAl, int LAO,
Tom Stellard75aadc22012-12-11 21:25:42 +000029 unsigned TransAl = 1);
Eugene Zelenko2bc2f332016-12-09 22:06:55 +000030 ~AMDGPUFrameLowering() override;
Tom Stellardf3b2a1e2013-02-06 17:32:29 +000031
32 /// \returns The number of 32-bit sub-registers that are used when storing
33 /// values to the stack.
Craig Topperee7b0f32014-04-30 05:53:27 +000034 unsigned getStackWidth(const MachineFunction &MF) const;
Tom Stellard75aadc22012-12-11 21:25:42 +000035};
Eugene Zelenko2bc2f332016-12-09 22:06:55 +000036
37} // end namespace llvm
38
39#endif // LLVM_LIB_TARGET_AMDGPU_AMDGPUFRAMELOWERING_H