]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h
MFC r316910: 7812 Remove gender specific language
[FreeBSD/FreeBSD.git] / contrib / llvm / lib / Target / AMDGPU / AMDGPUMachineFunction.h
1 //===-- AMDGPUMachineFunctionInfo.h -------------------------------*- C++ -*-=//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUMACHINEFUNCTION_H
11 #define LLVM_LIB_TARGET_AMDGPU_AMDGPUMACHINEFUNCTION_H
12
13 #include "llvm/ADT/DenseMap.h"
14 #include "llvm/CodeGen/MachineFunction.h"
15
16 namespace llvm {
17
18 class AMDGPUMachineFunction : public MachineFunctionInfo {
19   /// A map to keep track of local memory objects and their offsets within the
20   /// local memory space.
21   SmallDenseMap<const GlobalValue *, unsigned, 4> LocalMemoryObjects;
22
23   uint64_t KernArgSize;
24   unsigned MaxKernArgAlign;
25
26   /// Number of bytes in the LDS that are being used.
27   unsigned LDSSize;
28
29   // FIXME: This should probably be removed.
30   /// Start of implicit kernel args
31   unsigned ABIArgOffset;
32
33   // Kernels + shaders. i.e. functions called by the driver and not not called
34   // by other functions.
35   bool IsEntryFunction;
36
37   bool NoSignedZerosFPMath;
38
39 public:
40   AMDGPUMachineFunction(const MachineFunction &MF);
41
42   uint64_t allocateKernArg(uint64_t Size, unsigned Align) {
43     assert(isPowerOf2_32(Align));
44     KernArgSize = alignTo(KernArgSize, Align);
45
46     uint64_t Result = KernArgSize;
47     KernArgSize += Size;
48
49     MaxKernArgAlign = std::max(Align, MaxKernArgAlign);
50     return Result;
51   }
52
53   uint64_t getKernArgSize() const {
54     return KernArgSize;
55   }
56
57   unsigned getMaxKernArgAlign() const {
58     return MaxKernArgAlign;
59   }
60
61   void setABIArgOffset(unsigned NewOffset) {
62     ABIArgOffset = NewOffset;
63   }
64
65   unsigned getABIArgOffset() const {
66     return ABIArgOffset;
67   }
68
69   unsigned getLDSSize() const {
70     return LDSSize;
71   }
72
73   bool isEntryFunction() const {
74     return IsEntryFunction;
75   }
76
77   bool hasNoSignedZerosFPMath() const {
78     return NoSignedZerosFPMath;
79   }
80
81   unsigned allocateLDSGlobal(const DataLayout &DL, const GlobalValue &GV);
82 };
83
84 }
85 #endif