File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -319,3 +319,26 @@ Generated constructor contains a call to
319
319
` __register_uniquely_identifiable_object ` for each global variable which has
320
320
` sycl-unique-id ` and ` sycl-uid-kind ` attributes, passing values of those
321
321
attributes into the corresponding arguments of the function.
322
+
323
+ ### Handling shadowed variables
324
+
325
+ Unlike with the integration footer the problem with shadowed variables doesn't
326
+ really exists with the custom host compiler approach, because it is compiler
327
+ responsibility to uniquely identify shadowed variables at LLVM IR level and we
328
+ are simply re-using what is already there.
329
+
330
+ For example, for the following code snippet:
331
+
332
+ ```
333
+ sycl::device_global<int> FuBar;
334
+ namespace {
335
+ sycl::device_global<int> FuBar;
336
+ }
337
+ ```
338
+
339
+ The following IR is generated by our host compiler:
340
+
341
+ ```
342
+ @FuBar = dso_local global %"class.cl::sycl::ext::oneapi::device_global" zeroinitializer, align 8
343
+ @_ZN12_GLOBAL__N_15FuBarE = internal global %"class.cl::sycl::ext::oneapi::device_global" zeroinitializer, align 8
344
+ ```
You can’t perform that action at this time.
0 commit comments