LLVM 19.0.0git
SIProgramInfo.cpp
Go to the documentation of this file.
1//===-- SIProgramInfo.cpp ----------------------------------------------===//
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///
11/// The SIProgramInfo tracks resource usage and hardware flags for kernels and
12/// entry functions.
13//
14//===----------------------------------------------------------------------===//
15//
16
17#include "SIProgramInfo.h"
18#include "GCNSubtarget.h"
19#include "SIDefines.h"
21
22using namespace llvm;
23
29
30 if (ST.hasDX10ClampMode())
32
33 if (ST.hasIEEEMode())
35
36 if (ST.hasRrWGMode())
38
39 return Reg;
40}
41
43 const GCNSubtarget &ST) const {
44 if (AMDGPU::isCompute(CC)) {
45 return getComputePGMRSrc1(ST);
46 }
50
51 if (ST.hasDX10ClampMode())
53
54 if (ST.hasIEEEMode())
56
57 if (ST.hasRrWGMode())
59
60 switch (CC) {
63 break;
66 break;
69 break;
72 break;
73 default:
74 break;
75 }
76 return Reg;
77}
78
80 uint64_t Reg =
88
89 return Reg;
90}
91
94 return getComputePGMRSrc2();
95
96 return 0;
97}
AMD GCN specific subclass of TargetSubtarget.
#define S_00B84C_EXCP_EN(x)
Definition: SIDefines.h:1115
#define S_00B428_MEM_ORDERED(x)
Definition: SIDefines.h:1076
#define S_00B028_MEM_ORDERED(x)
Definition: SIDefines.h:1052
#define S_00B84C_SCRATCH_EN(x)
Definition: SIDefines.h:1083
#define S_00B84C_TGID_Z_EN(x)
Definition: SIDefines.h:1098
#define S_00B228_WGP_MODE(x)
Definition: SIDefines.h:1064
#define S_00B848_MEM_ORDERED(x)
Definition: SIDefines.h:1153
#define S_00B228_MEM_ORDERED(x)
Definition: SIDefines.h:1067
#define S_00B848_RR_WG_MODE(x)
Definition: SIDefines.h:1141
#define S_00B84C_TGID_X_EN(x)
Definition: SIDefines.h:1092
#define S_00B848_DEBUG_MODE(x)
Definition: SIDefines.h:1144
#define S_00B428_WGP_MODE(x)
Definition: SIDefines.h:1073
#define S_00B848_PRIV(x)
Definition: SIDefines.h:1135
#define S_00B84C_TG_SIZE_EN(x)
Definition: SIDefines.h:1101
#define S_00B84C_TIDIG_COMP_CNT(x)
Definition: SIDefines.h:1104
#define S_00B84C_LDS_SIZE(x)
Definition: SIDefines.h:1112
#define S_00B84C_USER_SGPR(x)
Definition: SIDefines.h:1086
#define S_00B84C_TRAP_HANDLER(x)
Definition: SIDefines.h:1089
#define S_00B84C_TGID_Y_EN(x)
Definition: SIDefines.h:1095
#define S_00B128_MEM_ORDERED(x)
Definition: SIDefines.h:1059
#define S_00B848_WGP_MODE(x)
Definition: SIDefines.h:1150
#define S_00B848_SGPRS(x)
Definition: SIDefines.h:1126
#define S_00B84C_EXCP_EN_MSB(x)
Definition: SIDefines.h:1108
#define S_00B848_DX10_CLAMP(x)
Definition: SIDefines.h:1138
#define S_00B848_VGPRS(x)
Definition: SIDefines.h:1123
#define S_00B848_PRIORITY(x)
Definition: SIDefines.h:1129
#define S_00B848_IEEE_MODE(x)
Definition: SIDefines.h:1147
#define S_00B848_FLOAT_MODE(x)
Definition: SIDefines.h:1132
Defines struct to track resource usage and hardware flags for kernels and entry functions.
bool isCompute(CallingConv::ID cc)
@ AMDGPU_VS
Used for Mesa vertex shaders, or AMDPAL last shader stage before rasterization (vertex shader if tess...
Definition: CallingConv.h:188
@ AMDGPU_HS
Used for Mesa/AMDPAL hull shaders (= tessellation control shaders).
Definition: CallingConv.h:206
@ AMDGPU_GS
Used for Mesa/AMDPAL geometry shaders.
Definition: CallingConv.h:191
@ AMDGPU_PS
Used for Mesa/AMDPAL pixel shaders.
Definition: CallingConv.h:194
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
uint64_t getComputePGMRSrc1(const GCNSubtarget &ST) const
Compute the value of the ComputePGMRsrc1 register.
uint32_t TrapHandlerEnable
Definition: SIProgramInfo.h:49
uint64_t getComputePGMRSrc2() const
Compute the value of the ComputePGMRsrc2 register.
uint64_t getPGMRSrc2(CallingConv::ID CC) const
uint64_t getPGMRSrc1(CallingConv::ID CC, const GCNSubtarget &ST) const