Details
- Reviewers
arsenm b-sumner yaxunl - Commits
- rG59691dc8740c: [AMDGPU] Make ds fp atomics overloadable
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/CodeGen/CGBuiltin.cpp | ||
---|---|---|
14772 | I don't think you need a cast here (at least an addrspacecast) |
clang/lib/CodeGen/CGBuiltin.cpp | ||
---|---|---|
14772 | If removed builtins-amdgcn.cu fails. It is CUDA with LDS pointer passed as flat. I.e. it comes as cast from addrspace(3) to flat. Generic builtin handling below in this file does the same. |
clang/lib/CodeGen/CGBuiltin.cpp | ||
---|---|---|
14772 | I thought these casts would be present in the AST? |
clang/lib/CodeGen/CGBuiltin.cpp | ||
---|---|---|
14772 | It comes as a flat pointer. I am just replicating what generic code does. |
clang/lib/CodeGen/CGBuiltin.cpp | ||
---|---|---|
14772 | Check the code around the line 4440 in the same file. It does even more than that. |
clang/lib/CodeGen/CGBuiltin.cpp | ||
---|---|---|
14772 | There was a TargetInfo hook getCUDABuiltinAddressSpace which was introduced by Matt. The default implementation maps any address space to default address space 0. For some reason, it was not implemented as target specific to map the address space specified by builtin def to real ones. As a result, all builtin functions have generic pointer parameter for CUDA. Therefore the cast is needed here when calling the intrinsic. We could consider fix that. For this patch, I think we still need the cast. |
I don't think you need a cast here (at least an addrspacecast)