Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DeviceMSAN] Support MemorySanitizer for device offloading #15955

Open
wants to merge 28 commits into
base: sycl
Choose a base branch
from

Conversation

AllanZyne
Copy link
Contributor

@AllanZyne AllanZyne commented Nov 1, 2024

@AllanZyne AllanZyne changed the base branch from sycl to review/yang/restructure_asan November 21, 2024 05:59
@AllanZyne AllanZyne requested a review from a team as a code owner November 25, 2024 09:22
@AllanZyne
Copy link
Contributor Author

Hi @intel/llvm-reviewers-runtime
@intel/dpcpp-clang-driver-reviewers
@intel/dpcpp-tools-reviewers
@intel/dpcpp-esimd-reviewers, please review. Thanks!

@@ -790,6 +791,13 @@ processInputModule(std::unique_ptr<Module> M) {
if (M->getTargetTriple().find("spir") != std::string::npos)
Modified |= removeDeviceGlobalFromCompilerUsed(*M.get());

// AddressSanitizer specific passes
Copy link
Contributor

Choose a reason for hiding this comment

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

MemorySanitizer? And should the line 797 is MsanKernel?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

MemorySanitizer? And should the line 797 is MsanKernel?

I'm going to unify "AsanKernelMetadata" and "MsanKernelMetadata", so I used a more general name here.

llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp Outdated Show resolved Hide resolved
// the list of defined symbols.
if (SF->isIR() &&
(Name == "llvm.used" || Name == "llvm.compiler.used" ||
Name == "__AsanDeviceGlobalMetadata"))
Name == "__AsanDeviceGlobalMetadata" ||
Name == "__MsanKernelMetadata"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the name is different for ASAN and MSAN?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. I will merge them in other patch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently, I handle them all in SanitizerKernelMetadata Pass, and don't use a same name, because I'm not sure if their content will be different.

Copy link
Contributor

@zhaomaosu zhaomaosu left a comment

Choose a reason for hiding this comment

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

lgtm

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.

3 participants