Scott Linder | 2ad2c18 | 2018-07-10 17:31:32 +0000 | [diff] [blame] | 1 | //===--- SIProgramInfo.h ----------------------------------------*- C++ -*-===// |
| 2 | // |
Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 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 |
Scott Linder | 2ad2c18 | 2018-07-10 17:31:32 +0000 | [diff] [blame] | 6 | // |
| 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 | |
| 18 | namespace llvm { |
| 19 | |
| 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; |
Stanislav Mekhanoshin | 41bbe10 | 2019-05-03 21:26:39 +0000 | [diff] [blame] | 31 | uint32_t WgpMode = 0; // GFX10+ |
| 32 | uint32_t MemOrdered = 0; // GFX10+ |
Scott Linder | 2ad2c18 | 2018-07-10 17:31:32 +0000 | [diff] [blame] | 33 | uint64_t ScratchSize = 0; |
| 34 | |
| 35 | uint64_t ComputePGMRSrc1 = 0; |
| 36 | |
| 37 | // Fields set in PGM_RSRC2 pm4 packet. |
| 38 | uint32_t LDSBlocks = 0; |
| 39 | uint32_t ScratchBlocks = 0; |
| 40 | |
| 41 | uint64_t ComputePGMRSrc2 = 0; |
| 42 | |
| 43 | uint32_t NumVGPR = 0; |
Stanislav Mekhanoshin | 075bc48 | 2019-10-02 00:26:58 +0000 | [diff] [blame] | 44 | uint32_t NumArchVGPR = 0; |
| 45 | uint32_t NumAccVGPR = 0; |
Scott Linder | 2ad2c18 | 2018-07-10 17:31:32 +0000 | [diff] [blame] | 46 | uint32_t NumSGPR = 0; |
| 47 | uint32_t LDSSize = 0; |
| 48 | bool FlatUsed = false; |
| 49 | |
| 50 | // Number of SGPRs that meets number of waves per execution unit request. |
| 51 | uint32_t NumSGPRsForWavesPerEU = 0; |
| 52 | |
| 53 | // Number of VGPRs that meets number of waves per execution unit request. |
| 54 | uint32_t NumVGPRsForWavesPerEU = 0; |
| 55 | |
Stanislav Mekhanoshin | 2594fa8 | 2019-07-31 01:07:10 +0000 | [diff] [blame] | 56 | // Final occupancy. |
| 57 | uint32_t Occupancy = 0; |
| 58 | |
Scott Linder | 2ad2c18 | 2018-07-10 17:31:32 +0000 | [diff] [blame] | 59 | // Whether there is recursion, dynamic allocas, indirect calls or some other |
| 60 | // reason there may be statically unknown stack usage. |
| 61 | bool DynamicCallStack = false; |
| 62 | |
| 63 | // Bonus information for debugging. |
| 64 | bool VCCUsed = false; |
| 65 | |
| 66 | SIProgramInfo() = default; |
| 67 | }; |
| 68 | |
| 69 | } // namespace llvm |
| 70 | |
| 71 | #endif // LLVM_LIB_TARGET_AMDGPU_SIPROGRAMINFO_H |