1 //===----------------------- AMDGPUFrameLowering.cpp ----------------------===//
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
7 //==-----------------------------------------------------------------------===//
9 // Interface to describe a layout of a stack frame on a AMDGPU target machine.
11 //===----------------------------------------------------------------------===//
13 #include "AMDGPUFrameLowering.h"
16 AMDGPUFrameLowering::AMDGPUFrameLowering(StackDirection D
, unsigned StackAl
,
17 int LAO
, unsigned TransAl
)
18 : TargetFrameLowering(D
, StackAl
, LAO
, TransAl
) { }
20 AMDGPUFrameLowering::~AMDGPUFrameLowering() = default;
22 unsigned AMDGPUFrameLowering::getStackWidth(const MachineFunction
&MF
) const {
23 // XXX: Hardcoding to 1 for now.
25 // I think the StackWidth should stored as metadata associated with the
26 // MachineFunction. This metadata can either be added by a frontend, or
27 // calculated by a R600 specific LLVM IR pass.
29 // The StackWidth determines how stack objects are laid out in memory.
30 // For a vector stack variable, like: int4 stack[2], the data will be stored
31 // in the following ways depending on the StackWidth.