This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SVE] Add asm predicate constraint Uph
ClosedPublic

Authored by MattDevereau on Aug 9 2023, 9:01 AM.

Details

Summary

Some instructions such as multi-vector LD1 only accept a range
of PN8-PN15 predicate-as-counter. This new constraint allows more
refined parsing and better decision making when parsing these
instructions from ASM, instead of defaulting to Upa which incorrectly
uses the whole range of registers P0-P15 from the register class PPR.

Diff Detail

Event Timeline

MattDevereau created this revision.Aug 9 2023, 9:01 AM
MattDevereau requested review of this revision.Aug 9 2023, 9:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 9 2023, 9:01 AM
llvm/docs/LangRef.rst
5000

nit: upper

llvm/test/CodeGen/AArch64/aarch64-sve-asm.ll
78

nit: can you find a more appropriate name?

Updated test name & updated wording in LangRef.rst

MattDevereau marked 2 inline comments as done.Aug 9 2023, 9:15 AM
sdesmalen accepted this revision.Aug 9 2023, 12:37 PM
sdesmalen added inline comments.
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
9993–10015

nit: you could choose to use a StringSwitch for this, e.g.

return StringSwitch<PredicateConstraint>(Constraint)
               .Case("Uph", PredicateConstraint::Uph)
               .Case("Upl", PredicateConstraint::Upl)
               .Case("Upa", PredicateConstraint::Upa)
               .Default(PredicateConstraint::Invalid);
This revision is now accepted and ready to land.Aug 9 2023, 12:37 PM
Matt added a subscriber: Matt.Aug 9 2023, 3:46 PM

@sdesmalen I had to make an additional changes to clang/lib/Basic/Targets/AArch64.cpp and clang/test/CodeGen/aarch64-sve-inline-asm-datatypes.c To get the constraint parsing from the clang level. It's pretty minor but thought I'd update the review before pushing in case you've anything to add.

Herald added a project: Restricted Project. · View Herald TranscriptAug 10 2023, 4:11 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
This revision was automatically updated to reflect the committed changes.