llvm icon indicating copy to clipboard operation
llvm copied to clipboard

[clang] Modify linkage and register initialization of `device_global`

Open hdelan opened this issue 1 year ago • 1 comments

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

hdelan avatar Aug 20 '24 15:08 hdelan

Ping @intel/dpcpp-cfe-reviewers

hdelan avatar Aug 28 '24 16:08 hdelan