[PATCH] D47154: Try to make builtin address space declarations not useless
Matt Arsenault via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Jul 29 02:13:35 PDT 2018
arsenm added inline comments.
================
Comment at: include/clang/Basic/TargetInfo.h:1157
+ /// language address space.
+ virtual LangAS getCUDABuiltinAddressSpace(unsigned AS) const {
+ return getLangASFromTargetAS(AS);
----------------
yaxunl wrote:
> I think this function is not needed.
>
> Although CUDA/HIP uses address spaces in codegen, but it does not use named address spaces in sema and AST. Named address space is not in the AST types of CUDA/HIP, therefore there is no point of mapping target address space back to language address space for CUDA/HIP.
>
> CUDA/HIP should be just like other address-space-agnostic language and always use getLangASFromTargetAS(AS).
This is necessary to insert the correct addrspacecast, otherwise the builtins CUDA test asserts. getLangASFromTargetAS returns the user specified addrspace
https://reviews.llvm.org/D47154
More information about the cfe-commits
mailing list