| Issue |
241525
|
| Summary |
[CIR][AMDGPU] Implement the remaining AMDGPU target builtins in CIRGen
|
| Labels |
good first issue,
backend:AMDGPU,
ClangIR
|
| Assignees |
|
| Reporter |
ayokunle321
|
A number of AMDGPU builtins still hit `errorNYI` in CIRGen, so they can't be compiled through ClangIR yet. This issue collects the ones that are left so they can be knocked out incrementally.
There's no lowering work involved here sincethese builtins map one-to-one onto their `amdgcn.*` LLVM intrinsic, and that lowering is already in place, so all that's needed is the CIRGen codegen for each one.
For a given builtin, add the case in `clang/lib/CIR/CodeGen/CIRGenBuiltinAMDGPU.cpp` (most are a near-copy of a case that's already there), and use the classic CodeGen path in [AMDGPU.cpp](https://github.com/llvm/llvm-project/blob/main/clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp) as a reference for the expected behaviour. For the test, the existing AMDGPU builtin tests under [clang/test/CodeGenOpenCL/](https://github.com/llvm/llvm-project/tree/main/clang/test/CodeGenOpenCL)
and [clang/test/CodeGen/](https://github.com/llvm/llvm-project/tree/main/clang/test/CodeGen) are a good references for the expected IR.
You could check out earlier [AMDGPU builtin PRs](https://github.com/llvm/llvm-project/pulls?q=is%3Apr+state%3Aclosed+author%3Aayokunle321+amdgpu) to get an idea of how one should look like.
- [ ] `__builtin_amdgcn_log_clampf`
- [ ] `__builtin_amdgcn_frexp_exp`
- [ ] `__builtin_amdgcn_frexp_expf`
- [ ] `__builtin_amdgcn_frexp_exph`
- [ ] `__builtin_amdgcn_lerp`
- [ ] `__builtin_amdgcn_alignbit`
- [ ] `__builtin_amdgcn_s_prefetch_data`
- [ ] `__builtin_amdgcn_s_prefetch_inst`
- [ ] `__builtin_amdgcn_mov_dpp`
- [ ] `__builtin_amdgcn_mov_dpp8`
- [ ] `__builtin_amdgcn_update_dpp`
No need to ask to be assigned. Since this is a list, just grab one that isn't checked off and open a PR. A quick comment to say which one you're taking helps avoid overlap. Happy to help if anything's unclear.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs