Skip to content

[DeviceSanitizer] Move sanitizer predicates to new SanitizerUtils.h - #22915

Merged
kswiecicki merged 3 commits into
intel:syclfrom
wenju-he:SanitizerUtils.h
Aug 12, 2026
Merged

[DeviceSanitizer] Move sanitizer predicates to new SanitizerUtils.h#22915
kswiecicki merged 3 commits into
intel:syclfrom
wenju-he:SanitizerUtils.h

Conversation

@wenju-he

Copy link
Copy Markdown
Contributor

This is follow-up of review comment
#22901 (comment)

isModuleUsingAsan/Msan/Tsan are sanitizer-specific, not generic SYCL utilities, so move them out of SYCLLowerIR/SYCLUtils.{h,cpp} into a new SanitizerUtils.{h,cpp}. Also add ASAN/MSAN/TSAN_KERNEL_METADATA_PREFIX constants there so the "__{Asan,Msan,Tsan}KernelMetadata" prefix strings have a single definition instead of being duplicated as literals across SanitizerPostOptimizer.cpp, SanitizerPostSplitProcessing.cpp, and clang's OffloadBundler.cpp.

This is follow-up of review comment
intel#22901 (comment)

isModuleUsingAsan/Msan/Tsan are sanitizer-specific, not generic SYCL
utilities, so move them out of SYCLLowerIR/SYCLUtils.{h,cpp} into a
new SanitizerUtils.{h,cpp}. Also add ASAN/MSAN/TSAN_KERNEL_METADATA_PREFIX
constants there so the "__{Asan,Msan,Tsan}KernelMetadata" prefix strings
have a single definition instead of being duplicated as literals across
SanitizerPostOptimizer.cpp, SanitizerPostSplitProcessing.cpp, and
clang's OffloadBundler.cpp.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
#include "llvm/IR/Module.h"

namespace llvm {
namespace sycl {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should we change the namespace?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should we change the namespace?

moved them into llvm::sycl::utils:: namespace, aligning with llvm/include/llvm/SYCLLowerIR/SYCLUtils.h

@YuriPlyakhin YuriPlyakhin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@sys-ce-bb

Copy link
Copy Markdown
Contributor

@intel/llvm-gatekeepers please consider merging

@kswiecicki
kswiecicki merged commit 88488af into intel:sycl Aug 12, 2026
31 checks passed
@wenju-he
wenju-he deleted the SanitizerUtils.h branch August 12, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants