llvm
llvm copied to clipboard
[clang] Modify linkage and register initialization of `device_global`
A SYCL device_global is initialized externally. We should make sure the frontend registers it as such to avoid it being removed in IPO optimizations.
Also a device_global should be given external linkage even when it
is static. If linkage is internal then the compiler may SRA a device_global,
which results in different symbols for host and device for the same
device_global.
Ping @frasercrmck @ldrumm @rafbiels
Ping @intel/dpcpp-cfe-reviewers