1 //===--- SIProgramInfo.h ----------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
10 /// Defines struct to track resource usage for kernels and entry functions.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_LIB_TARGET_AMDGPU_SIPROGRAMINFO_H
16 #define LLVM_LIB_TARGET_AMDGPU_SIPROGRAMINFO_H
20 /// Track resource usage for kernels / entry functions.
21 struct SIProgramInfo
{
22 // Fields set in PGM_RSRC1 pm4 packet.
23 uint32_t VGPRBlocks
= 0;
24 uint32_t SGPRBlocks
= 0;
25 uint32_t Priority
= 0;
26 uint32_t FloatMode
= 0;
28 uint32_t DX10Clamp
= 0;
29 uint32_t DebugMode
= 0;
30 uint32_t IEEEMode
= 0;
31 uint32_t WgpMode
= 0; // GFX10+
32 uint32_t MemOrdered
= 0; // GFX10+
33 uint64_t ScratchSize
= 0;
35 uint64_t ComputePGMRSrc1
= 0;
37 // Fields set in PGM_RSRC2 pm4 packet.
38 uint32_t LDSBlocks
= 0;
39 uint32_t ScratchBlocks
= 0;
41 uint64_t ComputePGMRSrc2
= 0;
46 bool FlatUsed
= false;
48 // Number of SGPRs that meets number of waves per execution unit request.
49 uint32_t NumSGPRsForWavesPerEU
= 0;
51 // Number of VGPRs that meets number of waves per execution unit request.
52 uint32_t NumVGPRsForWavesPerEU
= 0;
55 uint32_t Occupancy
= 0;
57 // Whether there is recursion, dynamic allocas, indirect calls or some other
58 // reason there may be statically unknown stack usage.
59 bool DynamicCallStack
= false;
61 // Bonus information for debugging.
64 SIProgramInfo() = default;
69 #endif // LLVM_LIB_TARGET_AMDGPU_SIPROGRAMINFO_H