This is an archive of the discontinued LLVM Phabricator instance.

[Clang][SVE] Permit specific predicate-as-counter registers in inline assembly
ClosedPublic

Authored by david-arm on Jul 24 2023, 6:04 AM.

Details

Summary

This patch adds the predicate-as-counter registers pn0-pn15 to the
list of supported registers used when writing inline assembly.

Tests added to

clang/test/CodeGen/aarch64-sve-inline-asm.c

Diff Detail

Event Timeline

david-arm created this revision.Jul 24 2023, 6:04 AM
Herald added a project: Restricted Project. · View Herald Transcript
david-arm requested review of this revision.Jul 24 2023, 6:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 24 2023, 6:04 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
MattDevereau added inline comments.Jul 24 2023, 6:14 AM
clang/test/CodeGen/aarch64-sve-inline-asm.c
20

I think it would be better to keep this test similar to test_sve_asm in that it tests both ends of the range of predicate registers and also tests it can be used as an operand to other valid instructions. Right now it feels like the bare minimum.

sdesmalen added inline comments.Jul 24 2023, 6:18 AM
clang/test/CodeGen/aarch64-sve-inline-asm.c
6

Could you also add a RUN line that compiles this to asm, just to make sure that LLVM accepts the inline asm syntax? There don't need to be any checks for the output.
This then probably also requires a REQUIRES: aarch64-registered-target.

21

x2 seems unused. Did you forget to assign it and to add some CHECK lines for it?

david-arm updated this revision to Diff 543529.Jul 24 2023, 7:00 AM
  • Addressed review comments on tests
david-arm marked 3 inline comments as done.Jul 24 2023, 7:00 AM
sdesmalen accepted this revision.Jul 24 2023, 7:38 AM
This revision is now accepted and ready to land.Jul 24 2023, 7:38 AM
Matt added a subscriber: Matt.Jul 24 2023, 10:15 AM
This revision was landed with ongoing or failed builds.Jul 25 2023, 1:56 AM
This revision was automatically updated to reflect the committed changes.