blob: 0b475919e6ddc6f765d65579d3190c1bf9669f46 [file] [log] [blame]
Scott Linder2ad2c182018-07-10 17:31:32 +00001//===--- SIProgramInfo.h ----------------------------------------*- C++ -*-===//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// 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
Scott Linder2ad2c182018-07-10 17:31:32 +00006//
7//===----------------------------------------------------------------------===//
8//
9/// \file
10/// Defines struct to track resource usage for kernels and entry functions.
11///
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_LIB_TARGET_AMDGPU_SIPROGRAMINFO_H
16#define LLVM_LIB_TARGET_AMDGPU_SIPROGRAMINFO_H
17
18namespace llvm {
19
20/// Track resource usage for kernels / entry functions.
21struct 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;
27 uint32_t Priv = 0;
28 uint32_t DX10Clamp = 0;
29 uint32_t DebugMode = 0;
30 uint32_t IEEEMode = 0;
31 uint64_t ScratchSize = 0;
32
33 uint64_t ComputePGMRSrc1 = 0;
34
35 // Fields set in PGM_RSRC2 pm4 packet.
36 uint32_t LDSBlocks = 0;
37 uint32_t ScratchBlocks = 0;
38
39 uint64_t ComputePGMRSrc2 = 0;
40
41 uint32_t NumVGPR = 0;
42 uint32_t NumSGPR = 0;
43 uint32_t LDSSize = 0;
44 bool FlatUsed = false;
45
46 // Number of SGPRs that meets number of waves per execution unit request.
47 uint32_t NumSGPRsForWavesPerEU = 0;
48
49 // Number of VGPRs that meets number of waves per execution unit request.
50 uint32_t NumVGPRsForWavesPerEU = 0;
51
Scott Linder2ad2c182018-07-10 17:31:32 +000052 // Whether there is recursion, dynamic allocas, indirect calls or some other
53 // reason there may be statically unknown stack usage.
54 bool DynamicCallStack = false;
55
56 // Bonus information for debugging.
57 bool VCCUsed = false;
58
59 SIProgramInfo() = default;
60};
61
62} // namespace llvm
63
64#endif // LLVM_LIB_TARGET_AMDGPU_SIPROGRAMINFO_H