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/ADT/DenseMap.h"
14 #include "llvm/CodeGen/MachineFunction.h"
20 class AMDGPUMachineFunction
: public MachineFunctionInfo
{
21 /// A map to keep track of local memory objects and their offsets within the
22 /// local memory space.
23 SmallDenseMap
<const GlobalValue
*, unsigned, 4> LocalMemoryObjects
;
26 uint64_t ExplicitKernArgSize
; // Cache for this.
27 unsigned MaxKernArgAlign
; // Cache for this.
29 /// Number of bytes in the LDS that are being used.
32 // Kernels + shaders. i.e. functions called by the driver and not called
33 // by other functions.
36 bool NoSignedZerosFPMath
;
38 // Function may be memory bound.
41 // Kernel may need limited waves per EU for better performance.
45 AMDGPUMachineFunction(const MachineFunction
&MF
);
47 uint64_t getExplicitKernArgSize() const {
48 return ExplicitKernArgSize
;
51 unsigned getMaxKernArgAlign() const {
52 return MaxKernArgAlign
;
55 unsigned getLDSSize() const {
59 bool isEntryFunction() const {
60 return IsEntryFunction
;
63 bool hasNoSignedZerosFPMath() const {
64 return NoSignedZerosFPMath
;
67 bool isMemoryBound() const {
71 bool needsWaveLimiter() const {
75 unsigned allocateLDSGlobal(const DataLayout
&DL
, const GlobalValue
&GV
);