1 //===-- AMDGPUMachineFunctionInfo.h -------------------------------*- C++ -*-=//
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 #ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUMACHINEFUNCTION_H
11 #define LLVM_LIB_TARGET_AMDGPU_AMDGPUMACHINEFUNCTION_H
13 #include "llvm/CodeGen/MachineFunction.h"
18 class AMDGPUMachineFunction : public MachineFunctionInfo {
20 unsigned MaxKernArgAlign;
22 virtual void anchor();
25 AMDGPUMachineFunction(const MachineFunction &MF);
27 uint64_t allocateKernArg(uint64_t Size, unsigned Align) {
28 assert(isPowerOf2_32(Align));
29 KernArgSize = alignTo(KernArgSize, Align);
31 uint64_t Result = KernArgSize;
34 MaxKernArgAlign = std::max(Align, MaxKernArgAlign);
38 /// A map to keep track of local memory objects and their offsets within
39 /// the local memory space.
40 std::map<const GlobalValue *, unsigned> LocalMemoryObjects;
41 /// Number of bytes in the LDS that are being used.
44 /// Start of implicit kernel args
45 unsigned ABIArgOffset;
47 bool isKernel() const;