1 //===----------------------- AMDGPUFrameLowering.cpp ----------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //==-----------------------------------------------------------------------===//
10 // Interface to describe a layout of a stack frame on a AMDGPU target machine.
12 //===----------------------------------------------------------------------===//
14 #include "AMDGPUFrameLowering.h"
17 AMDGPUFrameLowering::AMDGPUFrameLowering(StackDirection D
, unsigned StackAl
,
18 int LAO
, unsigned TransAl
)
19 : TargetFrameLowering(D
, StackAl
, LAO
, TransAl
) { }
21 AMDGPUFrameLowering::~AMDGPUFrameLowering() = default;
23 unsigned AMDGPUFrameLowering::getStackWidth(const MachineFunction
&MF
) const {
24 // XXX: Hardcoding to 1 for now.
26 // I think the StackWidth should stored as metadata associated with the
27 // MachineFunction. This metadata can either be added by a frontend, or
28 // calculated by a R600 specific LLVM IR pass.
30 // The StackWidth determines how stack objects are laid out in memory.
31 // For a vector stack variable, like: int4 stack[2], the data will be stored
32 // in the following ways depending on the StackWidth.