This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Account for implicit argument alignment for kernarg segment
ClosedPublic

Authored by arsenm on Oct 28 2021, 6:28 AM.

Details

Summary

If a kernel had no formal arguments but did have the implicit
arguments, we were reporting a required kernarg alignment of 4. For
some reason we require an 8-byte alignment for this, even though
there's no real advantage and I don't see where this is documented in
the ABI.

The code object header code also claims the minimum alignment is 16,
which is what I thought you always got at runtime anyway so I don't
know why this matters.

Diff Detail

Event Timeline

arsenm created this revision.Oct 28 2021, 6:28 AM
arsenm requested review of this revision.Oct 28 2021, 6:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 28 2021, 6:28 AM
Herald added a subscriber: wdng. · View Herald Transcript
kzhuravl accepted this revision.Nov 9 2021, 12:44 PM

LGTM

The metadata treats the minimum as 16?

I found some internal docs that say the minimum must be 16, but those docs describe the time when kernarg segment alignment was a part of kernel descriptor. So I believe metadata just inherited that. I will find out if it should stay the same in metadata and update the amdgpu usage accordingly. thanks.

This revision is now accepted and ready to land.Nov 9 2021, 12:44 PM