This is an archive of the discontinued LLVM Phabricator instance.

[SanitizerBinaryMetadata] Do not add to GPU code
ClosedPublic

Authored by melver on Mar 7 2023, 11:04 AM.

Details

Summary

SanitizerBinaryMetadata should only apply to to host code, and not GPU
code. Recently AMD GPU target code has experimental sanitizer support.

If we're compiling a mixed host/device source file, only add sanitizer
metadata to host code.

Diff Detail

Event Timeline

melver created this revision.Mar 7 2023, 11:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2023, 11:04 AM
melver requested review of this revision.Mar 7 2023, 11:04 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMar 7 2023, 11:04 AM
tra added a subscriber: tra.Mar 7 2023, 11:33 AM

LGTM for NVPTX.

llvm/lib/Transforms/Instrumentation/SanitizerBinaryMetadata.cpp
134

Nit: assert(!(TargetTriple.isNVPTX() || TargetTriple.isAMDGPU())) would be a bit easier to read.

melver updated this revision to Diff 503326.Mar 8 2023, 4:50 AM
melver marked an inline comment as done.

Simplify assert.

This revision was not accepted when it landed; it landed in state Needs Review.Mar 9 2023, 1:15 AM
This revision was automatically updated to reflect the committed changes.