Ensure field-annotations on pointers properly match the AS of the field.
authorErich Keane <erich.keane@intel.com>
Tue, 31 Aug 2021 16:50:01 +0000 (09:50 -0700)
committerErich Keane <erich.keane@intel.com>
Wed, 1 Sep 2021 13:12:24 +0000 (06:12 -0700)
commit42ae7eb581ff6abf77524f4c9e4333262c95aa4b
tree390e0ec1eaba3dfbb33983fbdc06e79251dbecec
parent9b6c8132d3785269512803ff51cb421f8d8bcf0e
Ensure field-annotations on pointers properly match the AS of the field.

Discovered in SYCL, the field annotations were always cast to an i8*,
which is an invalid bitcast for a pointer type with an address space.
This patch makes sure that we create an intrinsic that takes a pointer
to the correct address-space and properly do our casts.

Differential Revision: https://reviews.llvm.org/D109003
clang/lib/CodeGen/CodeGenFunction.cpp
clang/test/CodeGenSYCL/field-annotate-addr-space.cpp [new file with mode: 0644]