[AMDGPU] Add __builtin_amdgcn_workgroup_size_x/y/z
authorYaxun (Sam) Liu <yaxun.liu@amd.com>
Wed, 25 Mar 2020 13:50:51 +0000 (09:50 -0400)
committerYaxun (Sam) Liu <yaxun.liu@amd.com>
Sat, 28 Mar 2020 05:03:20 +0000 (01:03 -0400)
commit369e26ca9e0d9ceb87c70d26e9f13e793ee1ab40
tree633f44c3c7796fb6f6a720b1ff73a517ad854553
parent499b2a8d63ca9b319ce3aae462029f37ce7d96dd
[AMDGPU] Add __builtin_amdgcn_workgroup_size_x/y/z

The main purpose of introducing these builtins is to add a range
metadata [1, 1025) on the work group size loaded from dispatch
ptr, which cannot be done by source code.

Differential Revision: https://reviews.llvm.org/D76772
clang/include/clang/Basic/BuiltinsAMDGPU.def
clang/include/clang/Basic/TargetInfo.h
clang/lib/Basic/TargetInfo.cpp
clang/lib/CodeGen/CGBuiltin.cpp
clang/test/CodeGenCUDA/amdgpu-workgroup-size.cu [new file with mode: 0644]
clang/test/CodeGenOpenCL/builtins-amdgcn.cl