This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Add llvm.amdgcn.s.setprio intrinsic
ClosedPublic

Authored by kerbowa on Mar 4 2022, 12:27 AM.

Diff Detail

Event Timeline

kerbowa created this revision.Mar 4 2022, 12:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 4 2022, 12:27 AM
kerbowa requested review of this revision.Mar 4 2022, 12:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 4 2022, 12:27 AM
foad added a comment.Mar 4 2022, 1:13 AM

LGTM.

llvm/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.s.setprio.ll
1 ↗(On Diff #412946)

I'd suggest just adding -global-isel run lines to the normal test. No need for this file.

arsenm added inline comments.Mar 4 2022, 7:08 AM
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.s.setprio.ll
20

Should test the maximum value (and beyond it too)

kerbowa updated this revision to Diff 413508.Mar 7 2022, 8:53 AM

Remove gisel test and add gisel runline instead.
Test out-of-bounds values.

arsenm added inline comments.Mar 7 2022, 9:05 AM
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.s.setprio.ll
20

This is printing an unencodable value, should have sign extended or something

kerbowa added inline comments.Mar 7 2022, 9:19 AM
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.s.setprio.ll
20

Do you mean the test should have a sign extend or that it should not select with an unencodable value?

arsenm added inline comments.Mar 7 2022, 9:27 AM
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.s.setprio.ll
20

Ideally the frontend would diagnose, but I would expect discarding the extra bits on select

kerbowa updated this revision to Diff 413540.Mar 7 2022, 10:08 AM

Update type to match encoding.

arsenm accepted this revision.Mar 7 2022, 10:09 AM

LGTM. We were using i32 in the intrinsics everywhere else for immediate fields but I guess it doesn't really matter

This revision is now accepted and ready to land.Mar 7 2022, 10:09 AM
kerbowa added inline comments.Mar 7 2022, 10:10 AM
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.s.setprio.ll
20

Surprisingly, it is the same for other SOP intrinsics.

arsenm requested changes to this revision.Mar 7 2022, 10:16 AM

Should also add the clang builtin definition and test for the immarg diagnostic

This revision now requires changes to proceed.Mar 7 2022, 10:16 AM
kerbowa updated this revision to Diff 414559.Mar 10 2022, 7:00 PM

Add clang builtin and tests.

Herald added a project: Restricted Project. · View Herald TranscriptMar 10 2022, 7:00 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
arsenm accepted this revision.Mar 10 2022, 8:11 PM
This revision is now accepted and ready to land.Mar 10 2022, 8:11 PM
rampitec accepted this revision.Mar 11 2022, 10:00 AM
This revision was landed with ongoing or failed builds.Mar 12 2022, 10:16 PM
This revision was automatically updated to reflect the committed changes.