LLVM  14.0.0git
SIProgramInfo.h
Go to the documentation of this file.
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 and hardware flags for kernels and
11 /// entry functions.
12 ///
13 //
14 //===----------------------------------------------------------------------===//
15 
16 #ifndef LLVM_LIB_TARGET_AMDGPU_SIPROGRAMINFO_H
17 #define LLVM_LIB_TARGET_AMDGPU_SIPROGRAMINFO_H
18 
19 #include "llvm/IR/CallingConv.h"
20 #include <cstdint>
21 
22 namespace llvm {
23 
24 /// Track resource usage for kernels / entry functions.
25 struct SIProgramInfo {
26  // Fields set in PGM_RSRC1 pm4 packet.
35  uint32_t WgpMode = 0; // GFX10+
36  uint32_t MemOrdered = 0; // GFX10+
38 
39  // Fields set in PGM_RSRC2 pm4 packet.
42 
45 
53  bool FlatUsed = false;
54 
55  // Number of SGPRs that meets number of waves per execution unit request.
57 
58  // Number of VGPRs that meets number of waves per execution unit request.
60 
61  // Final occupancy.
63 
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;
67 
68  // Bonus information for debugging.
69  bool VCCUsed = false;
70 
71  SIProgramInfo() = default;
72 
73  /// Compute the value of the ComputePGMRsrc1 register.
76 };
77 
78 } // namespace llvm
79 
80 #endif // LLVM_LIB_TARGET_AMDGPU_SIPROGRAMINFO_H
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
llvm::SIProgramInfo::WgpMode
uint32_t WgpMode
Definition: SIProgramInfo.h:35
llvm::SIProgramInfo::NumSGPR
uint32_t NumSGPR
Definition: SIProgramInfo.h:51
llvm::SIProgramInfo::NumVGPR
uint32_t NumVGPR
Definition: SIProgramInfo.h:46
llvm::SIProgramInfo::NumSGPRsForWavesPerEU
uint32_t NumSGPRsForWavesPerEU
Definition: SIProgramInfo.h:56
llvm::SIProgramInfo::LDSSize
uint32_t LDSSize
Definition: SIProgramInfo.h:52
llvm::SIProgramInfo::AccumOffset
uint32_t AccumOffset
Definition: SIProgramInfo.h:49
llvm::SIProgramInfo::Priv
uint32_t Priv
Definition: SIProgramInfo.h:31
llvm::SIProgramInfo::MemOrdered
uint32_t MemOrdered
Definition: SIProgramInfo.h:36
llvm::SIProgramInfo::NumArchVGPR
uint32_t NumArchVGPR
Definition: SIProgramInfo.h:47
llvm::SIProgramInfo::ComputePGMRSrc2
uint64_t ComputePGMRSrc2
Definition: SIProgramInfo.h:43
llvm::SIProgramInfo::ScratchSize
uint64_t ScratchSize
Definition: SIProgramInfo.h:37
llvm::SIProgramInfo::NumVGPRsForWavesPerEU
uint32_t NumVGPRsForWavesPerEU
Definition: SIProgramInfo.h:59
llvm::SIProgramInfo::LDSBlocks
uint32_t LDSBlocks
Definition: SIProgramInfo.h:40
llvm::SIProgramInfo::ComputePGMRSrc3GFX90A
uint64_t ComputePGMRSrc3GFX90A
Definition: SIProgramInfo.h:44
llvm::SIProgramInfo::DynamicCallStack
bool DynamicCallStack
Definition: SIProgramInfo.h:66
llvm::CallingConv::ID
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition: CallingConv.h:24
llvm::SIProgramInfo::FloatMode
uint32_t FloatMode
Definition: SIProgramInfo.h:30
uint64_t
llvm::SIProgramInfo::DebugMode
uint32_t DebugMode
Definition: SIProgramInfo.h:33
llvm::SIProgramInfo::VGPRBlocks
uint32_t VGPRBlocks
Definition: SIProgramInfo.h:27
llvm::SIProgramInfo::getPGMRSrc1
uint64_t getPGMRSrc1(CallingConv::ID CC) const
Definition: SIProgramInfo.cpp:31
uint32_t
llvm::SIProgramInfo::FlatUsed
bool FlatUsed
Definition: SIProgramInfo.h:53
llvm::SIProgramInfo::IEEEMode
uint32_t IEEEMode
Definition: SIProgramInfo.h:34
llvm::SIProgramInfo::NumAccVGPR
uint32_t NumAccVGPR
Definition: SIProgramInfo.h:48
CallingConv.h
llvm::SIProgramInfo::Occupancy
uint32_t Occupancy
Definition: SIProgramInfo.h:62
llvm::SIProgramInfo::TgSplit
uint32_t TgSplit
Definition: SIProgramInfo.h:50
llvm::SIProgramInfo::SIProgramInfo
SIProgramInfo()=default
llvm::SIProgramInfo::VCCUsed
bool VCCUsed
Definition: SIProgramInfo.h:69
llvm::SIProgramInfo::getComputePGMRSrc1
uint64_t getComputePGMRSrc1() const
Compute the value of the ComputePGMRsrc1 register.
Definition: SIProgramInfo.cpp:23
llvm::SIProgramInfo
Track resource usage for kernels / entry functions.
Definition: SIProgramInfo.h:25
llvm::SIProgramInfo::Priority
uint32_t Priority
Definition: SIProgramInfo.h:29
llvm::SIProgramInfo::DX10Clamp
uint32_t DX10Clamp
Definition: SIProgramInfo.h:32
llvm::SIProgramInfo::ScratchBlocks
uint32_t ScratchBlocks
Definition: SIProgramInfo.h:41
llvm::SIProgramInfo::SGPRBlocks
uint32_t SGPRBlocks
Definition: SIProgramInfo.h:28