-
Notifications
You must be signed in to change notification settings - Fork 772
[DeviceSanitizer] Do sanitize for device globals in AddressSanitizer pass #13678
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
Conversation
…pass Now UR already implemented API "urProgramGetGlobalVariablePointer", so we can use it to query the size of device globals and remove "__AsanDeviceGlobalCount".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm.
I suggest add a flag to control this feature. |
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm from a high level, will leave in depth review to devsan reviewers
if (SF->isIR() && (Name == "llvm.used" || Name == "llvm.compiler.used")) | ||
// llvm.used and llvm.compiler.used and __AsanDeviceGlobalMetadata to | ||
// the list of defined symbols. | ||
if (SF->isIR() && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we upstream this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a device sanitizer specific change, it's better to only keep it in intel/llvm unless we have plans to upstream whole device sanitizer implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
llvm/test/Instrumentation/AddressSanitizer/SPIRV/device_global.ll
Outdated
Show resolved
Hide resolved
llvm/test/Instrumentation/AddressSanitizer/SPIRV/device_global_non_image_scope.ll
Outdated
Show resolved
Hide resolved
@intel/llvm-gatekeepers Please merge |
Now UR already implemented API "urProgramGetGlobalVariablePointer", so we can use it to query the size of device globals and remove "__AsanDeviceGlobalCount".
UR Part: oneapi-src/unified-runtime#1584