1 //===--- SIProgramInfo.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 //===----------------------------------------------------------------------===//
11 /// Defines struct to track resource usage for kernels and entry functions.
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_LIB_TARGET_AMDGPU_SIPROGRAMINFO_H
17 #define LLVM_LIB_TARGET_AMDGPU_SIPROGRAMINFO_H
21 /// Track resource usage for kernels / entry functions.
22 struct SIProgramInfo
{
23 // Fields set in PGM_RSRC1 pm4 packet.
24 uint32_t VGPRBlocks
= 0;
25 uint32_t SGPRBlocks
= 0;
26 uint32_t Priority
= 0;
27 uint32_t FloatMode
= 0;
29 uint32_t DX10Clamp
= 0;
30 uint32_t DebugMode
= 0;
31 uint32_t IEEEMode
= 0;
32 uint64_t ScratchSize
= 0;
34 uint64_t ComputePGMRSrc1
= 0;
36 // Fields set in PGM_RSRC2 pm4 packet.
37 uint32_t LDSBlocks
= 0;
38 uint32_t ScratchBlocks
= 0;
40 uint64_t ComputePGMRSrc2
= 0;
45 bool FlatUsed
= false;
47 // Number of SGPRs that meets number of waves per execution unit request.
48 uint32_t NumSGPRsForWavesPerEU
= 0;
50 // Number of VGPRs that meets number of waves per execution unit request.
51 uint32_t NumVGPRsForWavesPerEU
= 0;
53 // Fixed SGPR number used to hold wave scratch offset for entire kernel
54 // execution, or std::numeric_limits<uint16_t>::max() if the register is not
56 uint16_t DebuggerWavefrontPrivateSegmentOffsetSGPR
=
57 std::numeric_limits
<uint16_t>::max();
59 // Fixed SGPR number of the first 4 SGPRs used to hold scratch V# for entire
60 // kernel execution, or std::numeric_limits<uint16_t>::max() if the register
61 // is not used or not known.
62 uint16_t DebuggerPrivateSegmentBufferSGPR
=
63 std::numeric_limits
<uint16_t>::max();
65 // Whether there is recursion, dynamic allocas, indirect calls or some other
66 // reason there may be statically unknown stack usage.
67 bool DynamicCallStack
= false;
69 // Bonus information for debugging.
72 SIProgramInfo() = default;
77 #endif // LLVM_LIB_TARGET_AMDGPU_SIPROGRAMINFO_H