This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] New GFX11 intrinsic llvm.amdgcn.s.sendmsg.rtn
ClosedPublic

Authored by foad on Jun 8 2022, 8:53 AM.

Details

Summary

Add new intrinsic and codegen support for the s_sendmsg_rtn_b32 and
s_sendmsg_rtn_b64 instructions.

Diff Detail

Event Timeline

foad created this revision.Jun 8 2022, 8:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 8 2022, 8:53 AM
foad requested review of this revision.Jun 8 2022, 8:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 8 2022, 8:53 AM
foad added a reviewer: Restricted Project.Jun 8 2022, 8:54 AM
arsenm added inline comments.Jun 8 2022, 9:02 AM
llvm/include/llvm/IR/IntrinsicsAMDGPU.td
213

Missing a lot of the default attributes (which all of the other intrinsics are also currently missing)

llvm/test/CodeGen/AMDGPU/llvm.amdgcn.sendmsg.rtn.ll
128

Maybe test some invalid immediates?

foad updated this revision to Diff 435472.Jun 9 2022, 2:45 AM

Add tests with weird message numbers.

foad added inline comments.Jun 9 2022, 2:49 AM
llvm/include/llvm/IR/IntrinsicsAMDGPU.td
213

Is that an objection? :)

llvm/test/CodeGen/AMDGPU/llvm.amdgcn.sendmsg.rtn.ll
128

Done, but validity is a slippery concept here. Do you think these should be diagnosed at some stage? I would be tempted to say the intrinsic should at least accept any unsigned 8-bit immediate, which is what the instruction encodes.

(The next level of verification would be to insist that bit 7 is set, since that distinguishes messages that are expected to return something. And the next level after that would be to only accept the specific message numbers that are currently defined to do something useful.)

arsenm accepted this revision.Jun 9 2022, 5:33 PM
arsenm added inline comments.
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.sendmsg.rtn.ll
128

We don't have a consistent strategy. Some places use i16 to avoid this issue, others clamp the bits

This revision is now accepted and ready to land.Jun 9 2022, 5:33 PM
This revision was landed with ongoing or failed builds.Jun 10 2022, 12:21 AM
This revision was automatically updated to reflect the committed changes.