@@ -216,16 +216,16 @@ inline uptr MemToShadow(uptr addr, uint32_t as) {
216216#elif defined(__LIBDEVICE_CPU__)
217217 shadow_ptr = MemToShadow_CPU (addr);
218218#else
219- if (GetDeviceTy () == DeviceType::CPU) {
219+ if (LIKELY (GetMsanLaunchInfo-> DeviceTy == DeviceType::CPU) ) {
220220 shadow_ptr = MemToShadow_CPU (addr);
221- } else if (GetDeviceTy () == DeviceType::GPU_PVC) {
221+ } else if (GetMsanLaunchInfo-> DeviceTy == DeviceType::GPU_PVC) {
222222 shadow_ptr = MemToShadow_PVC (addr, as);
223- } else if (GetDeviceTy () == DeviceType::GPU_DG2) {
223+ } else if (GetMsanLaunchInfo-> DeviceTy == DeviceType::GPU_DG2) {
224224 shadow_ptr = MemToShadow_DG2 (addr, as);
225225 } else {
226226 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 ));
229229 }
230230#endif
231231
@@ -273,17 +273,17 @@ inline uptr MemToOrigin(uptr addr, uint32_t as) {
273273#elif defined(__LIBDEVICE_CPU__)
274274 origin_ptr = MemToOrigin_CPU (addr);
275275#else
276- if (GetDeviceTy () == DeviceType::CPU) {
276+ if (LIKELY (GetMsanLaunchInfo-> DeviceTy == DeviceType::CPU) ) {
277277 origin_ptr = MemToOrigin_CPU (aligned_addr);
278- } else if (GetDeviceTy () == DeviceType::GPU_PVC) {
278+ } else if (GetMsanLaunchInfo-> DeviceTy == DeviceType::GPU_PVC) {
279279 origin_ptr = MemToOrigin_PVC (aligned_addr, as);
280- } else if (GetDeviceTy () == DeviceType::GPU_DG2) {
280+ } else if (GetMsanLaunchInfo-> DeviceTy == DeviceType::GPU_DG2) {
281281 origin_ptr = MemToOrigin_DG2 (aligned_addr, as);
282282 } else {
283283 // Return clean shadow (0s) by default
284284 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 ));
287287 }
288288#endif
289289
@@ -743,7 +743,8 @@ DEVICE_EXTERN_C_NOINLINE void __msan_unpoison_shadow(uptr ptr, uint32_t as,
743743static __SYCL_CONSTANT__ const char __msan_print_private_base[] =
744744 " [kernel] __msan_set_private_base(sid=%llu): %p\n " ;
745745
746- inline void SetPrivateBaseImpl (__SYCL_PRIVATE__ void *ptr) {
746+ DEVICE_EXTERN_C_NOINLINE void
747+ __msan_set_private_base (__SYCL_PRIVATE__ void *ptr) {
747748 const size_t sid = SubGroupLinearId ();
748749 if (!GetMsanLaunchInfo || sid >= MSAN_MAX_SG_PRIVATE ||
749750 GetMsanLaunchInfo->PrivateShadowOffset == 0 ||
@@ -757,19 +758,6 @@ inline void SetPrivateBaseImpl(__SYCL_PRIVATE__ void *ptr) {
757758 SubGroupBarrier ();
758759}
759760
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-
773761static __SYCL_CONSTANT__ const char __msan_print_strided_copy_unsupport_type[] =
774762 " [kernel] __msan_unpoison_strided_copy: unsupported type(%d)\n " ;
775763
0 commit comments