This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Set implicit kernarg size to be of 256 bytes for code object version 5
ClosedPublic

Authored by cfang on Apr 6 2022, 3:31 PM.

Details

Summary

If implicitarg_ptr intrinsic is not used, set implicit kernarg size to 0, otherwise
set it to 256 bytes for code object version 5 (and beyond).

Diff Detail

Event Timeline

cfang created this revision.Apr 6 2022, 3:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 6 2022, 3:31 PM
cfang requested review of this revision.Apr 6 2022, 3:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 6 2022, 3:31 PM
Herald added a subscriber: wdng. · View Herald Transcript
arsenm added a comment.Apr 6 2022, 3:35 PM

This can be tested in the existing llvm/test/CodeGen/AMDGPU/llvm.amdgcn.implicitarg.ptr.ll

cfang added a comment.Apr 6 2022, 5:05 PM

This can be tested in the existing llvm/test/CodeGen/AMDGPU/llvm.amdgcn.implicitarg.ptr.ll

This will make things much complicated since version 5 will generates quite different code from version 2, also
the dumped variable names are different. Maybe we should only check the kernarg size for version 5.

cfang updated this revision to Diff 421061.Apr 6 2022, 6:26 PM

update LIT test

arsenm added inline comments.Apr 6 2022, 7:59 PM
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.implicitarg.ptr.ll
5

This is broken. You need to add back the GCN check prefix

cfang added inline comments.Apr 6 2022, 8:46 PM
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.implicitarg.ptr.ll
5

Can you tell how this is broken? It passed the test for my check.
The problem is that, if we add back the GCN check prefix, the COV5 check won't be able to check the label (When I add prefix to COV5 cases, the test will fail GCN check because COV5 is quite different).

cfang updated this revision to Diff 421083.Apr 6 2022, 9:07 PM

For the LIT test, add back the GCN check prefix. For the GCN checks that are common to code object version 2 and MESA but different from code object version 5, we split the checks to HSA (version 2) and MESA.

arsenm accepted this revision.Apr 7 2022, 6:30 AM
This revision is now accepted and ready to land.Apr 7 2022, 6:30 AM
This revision was landed with ongoing or failed builds.Apr 7 2022, 8:36 AM
This revision was automatically updated to reflect the committed changes.