Revert r354244 "[DAGCombiner] Eliminate dead stores to stack."
[llvm-complete.git] / lib / Target / AMDGPU / SIProgramInfo.h
blob279067baf6cf2e94bcc0a96379381edd085a1157
1 //===--- SIProgramInfo.h ----------------------------------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 /// \file
10 /// Defines struct to track resource usage for kernels and entry functions.
11 ///
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_LIB_TARGET_AMDGPU_SIPROGRAMINFO_H
16 #define LLVM_LIB_TARGET_AMDGPU_SIPROGRAMINFO_H
18 namespace llvm {
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;
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;
33 uint64_t ComputePGMRSrc1 = 0;
35 // Fields set in PGM_RSRC2 pm4 packet.
36 uint32_t LDSBlocks = 0;
37 uint32_t ScratchBlocks = 0;
39 uint64_t ComputePGMRSrc2 = 0;
41 uint32_t NumVGPR = 0;
42 uint32_t NumSGPR = 0;
43 uint32_t LDSSize = 0;
44 bool FlatUsed = false;
46 // Number of SGPRs that meets number of waves per execution unit request.
47 uint32_t NumSGPRsForWavesPerEU = 0;
49 // Number of VGPRs that meets number of waves per execution unit request.
50 uint32_t NumVGPRsForWavesPerEU = 0;
52 // Fixed SGPR number used to hold wave scratch offset for entire kernel
53 // execution, or std::numeric_limits<uint16_t>::max() if the register is not
54 // used or not known.
55 uint16_t DebuggerWavefrontPrivateSegmentOffsetSGPR =
56 std::numeric_limits<uint16_t>::max();
58 // Fixed SGPR number of the first 4 SGPRs used to hold scratch V# for entire
59 // kernel execution, or std::numeric_limits<uint16_t>::max() if the register
60 // is not used or not known.
61 uint16_t DebuggerPrivateSegmentBufferSGPR =
62 std::numeric_limits<uint16_t>::max();
64 // Whether there is recursion, dynamic allocas, indirect calls or some other
65 // reason there may be statically unknown stack usage.
66 bool DynamicCallStack = false;
68 // Bonus information for debugging.
69 bool VCCUsed = false;
71 SIProgramInfo() = default;
74 } // namespace llvm
76 #endif // LLVM_LIB_TARGET_AMDGPU_SIPROGRAMINFO_H