This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Start interpreting byref on kernel arguments
ClosedPublic

Authored by arsenm on May 8 2020, 7:37 AM.

Details

Summary

It doesn't make sense for kernel arguments to be passed on the stack,
but we can still interpret byref sensibly for constant and other
global-like address spaces.

These are treated identically to value aggregates placed in the kernel
argument list. A %struct.foo or %struct.foo addrspace(4)*
byref(sizeof(%struct.foo)) align(alignof(%struct.foo)) argument should
produce the same offsets and argument metadata.

This handles all 3 kernel ABI implementations, and the two HSA
metadata emission paths.

Diff Detail

Event Timeline

arsenm created this revision.May 8 2020, 7:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 8 2020, 7:37 AM
rampitec accepted this revision.May 8 2020, 11:10 AM
This revision is now accepted and ready to land.May 8 2020, 11:10 AM
arsenm updated this revision to Diff 277086.Jul 10 2020, 10:14 AM
arsenm retitled this revision from AMDGPU: Start interpreting byval on kernel arguments to AMDGPU: Start interpreting byref on kernel arguments.
arsenm edited the summary of this revision. (Show Details)

Switch to byref

rampitec accepted this revision.Jul 10 2020, 1:01 PM

LGTM with a nit.

llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.h
161–162

This is too long.

This revision is now accepted and ready to land.Jul 10 2020, 1:01 PM