This is an archive of the discontinued LLVM Phabricator instance.

[Clang][AArch64][SME] Add ZA zeroing intrinsics
ClosedPublic

Authored by bryanpkc on Sep 26 2022, 2:40 PM.

Details

Summary

This patch adds support for the following SME ACLE intrinsics (as defined
in https://arm-software.github.io/acle/main/acle.html):

  • svzero_mask_za
  • svzero_za

Co-authored-by: Sagar Kulkarni <sagar.kulkarni1@huawei.com>

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptSep 26 2022, 2:40 PM
sagarkulkarni19 requested review of this revision.Sep 26 2022, 2:40 PM
sagarkulkarni19 edited the summary of this revision. (Show Details)Sep 26 2022, 2:43 PM
bryanpkc commandeered this revision.Jan 9 2023, 4:38 AM
bryanpkc updated this revision to Diff 487384.
bryanpkc added a reviewer: sagarkulkarni19.
bryanpkc retitled this revision from [Clang][AArch64] Add SME zero intrinsic to [Clang][AArch64][SME] Add ZA zeroing intrinsics.
bryanpkc edited the summary of this revision. (Show Details)
bryanpkc edited the summary of this revision. (Show Details)Jan 27 2023, 2:36 AM
bryanpkc updated this revision to Diff 492680.Jan 27 2023, 2:45 AM

Update patch with more context.

bryanpkc updated this revision to Diff 526351.May 28 2023, 6:05 PM
Matt added a subscriber: Matt.Jun 5 2023, 12:24 PM
sdesmalen added inline comments.Jun 6 2023, 1:44 AM
clang/lib/CodeGen/CGBuiltin.cpp
9937–9938

Given that the type flags are a little precious (we've already used 42 out of the 64 bits) and there only being a single intrinsic for svzero, can you do something similar to what's done in EmitAArch64SVEBuiltinExpr and create a switch on BuiltinID instead?

clang/test/CodeGen/aarch64-sme-intrinsics/acle_sme_zero.c
14

These tests are missing some kind of ARM_SHARED_ZA_ATTR macro (similar to what you've done for ARM_STREAMING_ATTR in D127910 and D128648), because svzero requires ZA state to be available.

clang/test/Sema/aarch64-sme-intrinsics/acle_sme_imm.cpp
208

svzero is streaming-compatible, but does require shared_za. So you should probably change this to ARM_SHARED_ZA_ATTR (and add the #define for it)

bryanpkc updated this revision to Diff 531330.Jun 14 2023, 7:46 AM

Addressed @sdesmalen's comments.

bryanpkc updated this revision to Diff 532431.Jun 17 2023, 3:59 PM
bryanpkc marked 3 inline comments as done.

Rebased. NFC.

Other than my comment on the test, the patch looks good to me.

clang/test/CodeGen/aarch64-sme-intrinsics/acle_sme_zero.c
21

The new keyword attributes are a bit stricter on the placement.

Because this is a type attribute (as opposed to a declaration attribute), it should be placed like this:

void test_svzero_mask_za() ARM_SHARED_ZA_ATTR {

As I mentioned on D128648, I think it's better to remove all these macros for now and only add the attributes when we add diagnostics in Sema for missing attributes.

bryanpkc updated this revision to Diff 540838.Jul 16 2023, 5:26 PM

Removed the attribute macro as suggested.

bryanpkc marked an inline comment as done.Jul 16 2023, 5:27 PM
This revision is now accepted and ready to land.Jul 17 2023, 6:43 AM
This revision was landed with ongoing or failed builds.Jul 20 2023, 2:57 AM
This revision was automatically updated to reflect the committed changes.