]> granicus.if.org Git - clang/commit
[OpenCL] always use SPIR address spaces for kernel_arg_addr_space MD
authorPekka Jaaskelainen <pekka.jaaskelainen@tut.fi>
Mon, 14 Nov 2016 13:08:30 +0000 (13:08 +0000)
committerPekka Jaaskelainen <pekka.jaaskelainen@tut.fi>
Mon, 14 Nov 2016 13:08:30 +0000 (13:08 +0000)
commit15fbdaedd04c83892c1a67c251c7aae400778f42
tree7f74bf4333dc78d00846845356251a8c5183e926
parent5720c2a864923ed52b30aff41acdb7ad1d17d29d
[OpenCL] always use SPIR address spaces for kernel_arg_addr_space MD

It doesn't make sense to use the target's address space ids in this context as
this is metadata that should be referring to the "logical" OpenCL address spaces.
For flat AS machines like all "CPUs" in general, the logical AS info gets lost as
there's only one address space (0).

This commit changes the logic such that we always use the SPIR address space
ids for the argument metadata. It thus allows implementing the clGetKernelArgInfo()
and the other detection needs.

https://reviews.llvm.org/D26157

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@286819 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CodeGenFunction.cpp
test/CodeGenOpenCL/kernel-arg-info-single-as.cl [new file with mode: 0644]