This is an archive of the discontinued LLVM Phabricator instance.

[Clang] Create opaque type for AArch64 SVE2p1/SME2 svcount_t.
ClosedPublic

Authored by sdesmalen on Oct 27 2022, 10:06 AM.

Details

Summary

This patch adds the builtin type __SVCount_t to Clang, which is an opaque
scalable type defined in the SME2 C and C++ Language Extensions.

The type maps to the target("aarch64.svcount") LLVM IR type.

Diff Detail

Event Timeline

sdesmalen created this revision.Oct 27 2022, 10:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 27 2022, 10:06 AM
sdesmalen requested review of this revision.Oct 27 2022, 10:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 27 2022, 10:06 AM
sdesmalen updated this revision to Diff 496103.Feb 9 2023, 5:45 AM

Rebased patch to use target("aarch64.svcount")
Changed debug info for svcount to only print the first 2 bytes (rather than vscale x 2 bytes)

sdesmalen edited the summary of this revision. (Show Details)Mar 2 2023, 6:55 AM
paulwalker-arm added inline comments.Mar 2 2023, 9:26 AM
clang/lib/CodeGen/CGDebugInfo.cpp
730–742

Given predicates are stored byte wise perhaps it's worth being more explicit and saying "only the first 2 bytes are relevant"?

746

Do we need an assert that Info.NumVectors is 1 for svcount_t? I don't think we plan of having svcountx2_t, but if we did then I think this code is incorrect because UpperBound will not take the padding between the "live 16bit values" into account? And an assert would at least give us a modicum of protection.

sdesmalen updated this revision to Diff 502649.Mar 6 2023, 7:43 AM
  • Added assert to check that NumVectors=1 for svcount_t.
sdesmalen marked 2 inline comments as done.Mar 6 2023, 7:44 AM
paulwalker-arm accepted this revision.Mar 6 2023, 10:07 AM
This revision is now accepted and ready to land.Mar 6 2023, 10:07 AM
This revision was landed with ongoing or failed builds.Mar 7 2023, 6:44 AM
This revision was automatically updated to reflect the committed changes.