aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
diff options
context:
space:
mode:
authorJun Wang <jwang86@yahoo.com>2024-03-12 10:30:39 -0700
committerGitHub <noreply@github.com>2024-03-12 10:30:39 -0700
commitc4e517f59c086eafe2eb61d23197820f05be799c (patch)
tree9610e4f8ea160021ce0812c143f2954135f1ca8f /llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
parent93503aafcdc66837ecf220243aaa530c05c35895 (diff)
downloadllvm-c4e517f59c086eafe2eb61d23197820f05be799c.zip
llvm-c4e517f59c086eafe2eb61d23197820f05be799c.tar.gz
llvm-c4e517f59c086eafe2eb61d23197820f05be799c.tar.bz2
[AMDGPU] Adding the amdgpu_num_work_groups function attribute (#79035)
A new function attribute named amdgpu_num_work_groups is added. This attribute, which consists of three integers, allows programmers to let the compiler know the number of workgroups to be launched in each of the three dimensions and do optimizations based on that information. --------- Co-authored-by: Jun Wang <jun.wang7@amd.com>
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
index 52d6fe6..2569f40 100644
--- a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
@@ -46,6 +46,8 @@ SIMachineFunctionInfo::SIMachineFunctionInfo(const Function &F,
const GCNSubtarget &ST = *static_cast<const GCNSubtarget *>(STI);
FlatWorkGroupSizes = ST.getFlatWorkGroupSizes(F);
WavesPerEU = ST.getWavesPerEU(F);
+ MaxNumWorkGroups = ST.getMaxNumWorkGroups(F);
+ assert(MaxNumWorkGroups.size() == 3);
Occupancy = ST.computeOccupancy(F, getLDSSize());
CallingConv::ID CC = F.getCallingConv();