This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Sanitized functions require implicit arguments
ClosedPublic

Authored by arsenm on Dec 2 2021, 2:11 PM.

Details

Summary

Do not infer no-amdgpu-implicitarg-ptr for sanitized functions. If a
function is explicitly marked amdgpu-no-implicitarg-ptr and
sanitize_address, infer that it is required.

Diff Detail

Event Timeline

arsenm created this revision.Dec 2 2021, 2:11 PM
arsenm requested review of this revision.Dec 2 2021, 2:11 PM
Herald added a reviewer: baziotis. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: wdng. · View Herald Transcript
rampitec accepted this revision.Dec 2 2021, 2:41 PM
This revision is now accepted and ready to land.Dec 2 2021, 2:41 PM
JonChesterfield added inline comments.Dec 2 2021, 3:08 PM
llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
117

Whats the 'implicitArgPtr'? The comment suggests this refers to the hostcall/printf buffer thing at offset 24 but the function name does not. 'IMPLICIT_ARG_PTR' suggests this is an existing naming convention.

The backend docs refer to 'Implicit Argument Ptr' in one place but don't state what it is. Nearby in the doc is 'Any source language implicit this or self argument comes first as a pointer type.' which I'm guessing is a conflict of notation. Could we call whatever this thing is something other than 'implicit arg/argument ptr'?

arsenm added inline comments.Dec 2 2021, 3:11 PM
llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
117

It's the pointer to the implicit argument area in the kernarg segment. It's the base address, where at offset 24 is the hostcall buffer. I don't know what else it would be called. It's passed with the explicit kernel arguments in the same buffer

arsenm added inline comments.Dec 2 2021, 3:15 PM
llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
117

Plus it's already the name of the intrinsic