[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #75647)

2024-01-22 Thread Jun Wang via cfe-commits
https://github.com/jwanggit86 closed https://github.com/llvm/llvm-project/pull/75647 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #75647)

2024-01-16 Thread Krzysztof Drewniak via cfe-commits
krzysz00 wrote: Good to know that other targets have that sort of "how many work groups will be launched" information. Having that be a min/max (either per dimension or in total or both) may be the right approach here, and this could be a good excuse for the unification being talked about.

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #75647)

2024-01-16 Thread Alexey Bader via cfe-commits
bader wrote: > How does this attribute relate to `reqd_work_group_size` and related existing > attributes? They seems to be different/"unrelated". Based on the description of the `amdgpu-num-work-groups` attribute it provides "number of work-groups", whereas `reqd_work_group_size` provides

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #75647)

2024-01-15 Thread Krzysztof Drewniak via cfe-commits
krzysz00 wrote: I'd go with Matt's point: close this, and then add metadata for required launch grid sizes. Then you can update `AMDGPULowerKernelAttributes` to use said metadata. https://github.com/llvm/llvm-project/pull/75647 ___ cfe-commits

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #75647)

2024-01-15 Thread Jun Wang via cfe-commits
jwanggit86 wrote: @krzysz00 So how do you want to proceed? https://github.com/llvm/llvm-project/pull/75647 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #75647)

2024-01-09 Thread Matt Arsenault via cfe-commits
arsenm wrote: ping @krzysz00 https://github.com/llvm/llvm-project/pull/75647 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #75647)

2023-12-19 Thread Jun Wang via cfe-commits
jwanggit86 wrote: Two possible optimizations mentioned by the requester are, "1. This'll let the backend know the maximum size of the workgroup ID, and so we can do things like infer nsw or the ability to use a 16-bit add or so on 2. This could be used to optimize global sync stuff in the

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #75647)

2023-12-15 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-amdgpu Author: Jun Wang (jwanggit86) Changes A new function attribute named amdgpu-num-work-groups is added. This attribute allows programmers to let the compiler know the number of workgroups to be launched and do optimizations based on that

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #75647)

2023-12-15 Thread Jun Wang via cfe-commits
https://github.com/jwanggit86 created https://github.com/llvm/llvm-project/pull/75647 A new function attribute named amdgpu-num-work-groups is added. This attribute allows programmers to let the compiler know the number of workgroups to be launched and do optimizations based on that