@@ -216,16 +216,16 @@ inline uptr MemToShadow(uptr addr, uint32_t as) {
216
216
#elif defined(__LIBDEVICE_CPU__)
217
217
shadow_ptr = MemToShadow_CPU (addr);
218
218
#else
219
- if (GetDeviceTy () == DeviceType::CPU) {
219
+ if (LIKELY (GetMsanLaunchInfo-> DeviceTy == DeviceType::CPU) ) {
220
220
shadow_ptr = MemToShadow_CPU (addr);
221
- } else if (GetDeviceTy () == DeviceType::GPU_PVC) {
221
+ } else if (GetMsanLaunchInfo-> DeviceTy == DeviceType::GPU_PVC) {
222
222
shadow_ptr = MemToShadow_PVC (addr, as);
223
- } else if (GetDeviceTy () == DeviceType::GPU_DG2) {
223
+ } else if (GetMsanLaunchInfo-> DeviceTy == DeviceType::GPU_DG2) {
224
224
shadow_ptr = MemToShadow_DG2 (addr, as);
225
225
} else {
226
226
shadow_ptr = GetMsanLaunchInfo->CleanShadow ;
227
- MSAN_DEBUG (
228
- __spirv_ocl_printf (__msan_print_unsupport_device_type, GetDeviceTy () ));
227
+ MSAN_DEBUG (__spirv_ocl_printf (__msan_print_unsupport_device_type,
228
+ GetMsanLaunchInfo-> DeviceTy ));
229
229
}
230
230
#endif
231
231
@@ -273,17 +273,17 @@ inline uptr MemToOrigin(uptr addr, uint32_t as) {
273
273
#elif defined(__LIBDEVICE_CPU__)
274
274
origin_ptr = MemToOrigin_CPU (addr);
275
275
#else
276
- if (GetDeviceTy () == DeviceType::CPU) {
276
+ if (LIKELY (GetMsanLaunchInfo-> DeviceTy == DeviceType::CPU) ) {
277
277
origin_ptr = MemToOrigin_CPU (aligned_addr);
278
- } else if (GetDeviceTy () == DeviceType::GPU_PVC) {
278
+ } else if (GetMsanLaunchInfo-> DeviceTy == DeviceType::GPU_PVC) {
279
279
origin_ptr = MemToOrigin_PVC (aligned_addr, as);
280
- } else if (GetDeviceTy () == DeviceType::GPU_DG2) {
280
+ } else if (GetMsanLaunchInfo-> DeviceTy == DeviceType::GPU_DG2) {
281
281
origin_ptr = MemToOrigin_DG2 (aligned_addr, as);
282
282
} else {
283
283
// Return clean shadow (0s) by default
284
284
origin_ptr = GetMsanLaunchInfo->CleanShadow ;
285
- MSAN_DEBUG (
286
- __spirv_ocl_printf (__msan_print_unsupport_device_type, GetDeviceTy () ));
285
+ MSAN_DEBUG (__spirv_ocl_printf (__msan_print_unsupport_device_type,
286
+ GetMsanLaunchInfo-> DeviceTy ));
287
287
}
288
288
#endif
289
289
@@ -743,7 +743,8 @@ DEVICE_EXTERN_C_NOINLINE void __msan_unpoison_shadow(uptr ptr, uint32_t as,
743
743
static __SYCL_CONSTANT__ const char __msan_print_private_base[] =
744
744
" [kernel] __msan_set_private_base(sid=%llu): %p\n " ;
745
745
746
- inline void SetPrivateBaseImpl (__SYCL_PRIVATE__ void *ptr) {
746
+ DEVICE_EXTERN_C_NOINLINE void
747
+ __msan_set_private_base (__SYCL_PRIVATE__ void *ptr) {
747
748
const size_t sid = SubGroupLinearId ();
748
749
if (!GetMsanLaunchInfo || sid >= MSAN_MAX_SG_PRIVATE ||
749
750
GetMsanLaunchInfo->PrivateShadowOffset == 0 ||
@@ -757,19 +758,6 @@ inline void SetPrivateBaseImpl(__SYCL_PRIVATE__ void *ptr) {
757
758
SubGroupBarrier ();
758
759
}
759
760
760
- DEVICE_EXTERN_C_NOINLINE void
761
- __msan_set_private_base (__SYCL_PRIVATE__ void *ptr) {
762
- #if defined(__LIBDEVICE_CPU__)
763
- return ;
764
- #elif defined(__LIBDEVICE_DG2__) || defined(__LIBDEVICE_PVC__)
765
- SetPrivateBaseImpl (ptr);
766
- #else
767
- if (GetDeviceTy () == DeviceType::CPU)
768
- return ;
769
- SetPrivateBaseImpl (ptr);
770
- #endif
771
- }
772
-
773
761
static __SYCL_CONSTANT__ const char __msan_print_strided_copy_unsupport_type[] =
774
762
" [kernel] __msan_unpoison_strided_copy: unsupported type(%d)\n " ;
775
763
0 commit comments