[llvm-exegesis][NFC] Pass Instruction instead of bare Opcode
[llvm-core.git] / lib / Target / AMDGPU / SIProgramInfo.h
blob383f6b57580833ff1877a61773e8876761a3a6ca
1 //===--- SIProgramInfo.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 /// \file
11 /// Defines struct to track resource usage for kernels and entry functions.
12 ///
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_LIB_TARGET_AMDGPU_SIPROGRAMINFO_H
17 #define LLVM_LIB_TARGET_AMDGPU_SIPROGRAMINFO_H
19 namespace llvm {
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;
28 uint32_t Priv = 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;
42 uint32_t NumVGPR = 0;
43 uint32_t NumSGPR = 0;
44 uint32_t LDSSize = 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
55 // used or not known.
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.
70 bool VCCUsed = false;
72 SIProgramInfo() = default;
75 } // namespace llvm
77 #endif // LLVM_LIB_TARGET_AMDGPU_SIPROGRAMINFO_H