This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Add initial SDNode patterns for unary zvbb instructions
ClosedPublic

Authored by luke on Jul 13 2023, 9:26 AM.

Details

Summary

This patch adds pseudos and SDNode patterns for vbrev.v, vrev8.v, vclz.v,
vctz.v and vcpop.v.
I've only added them for integer element types so far since we're lacking tests
for floats.

Diff Detail

Event Timeline

luke created this revision.Jul 13 2023, 9:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2023, 9:26 AM
luke requested review of this revision.Jul 13 2023, 9:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2023, 9:26 AM
luke added inline comments.Jul 13 2023, 9:28 AM
llvm/lib/Target/RISCV/RISCVInstrInfoZvk.td
189

The mask pseudo isn't currently tested, but will hopefully be used by the VP nodes later. I can leave it out of this patch for now if people would prefer

luke updated this revision to Diff 540092.Jul 13 2023, 9:52 AM

Fix typo and add predicate to patterns

This revision is now accepted and ready to land.Jul 13 2023, 10:08 AM
4vtomat added inline comments.Jul 13 2023, 10:47 AM
llvm/lib/Target/RISCV/RISCVInstrInfoZvk.td
185

Thanks, overall it's great!
One minor thing, if it can follow the naming convention such as this, that would be more consistent~
I guess maybe something like: VPseudoUnaryV_V.

luke added inline comments.Jul 13 2023, 10:56 AM
llvm/lib/Target/RISCV/RISCVInstrInfoZvk.td
185

Sounds good, will do!
Btw, I was wondering since this multiclass isn't specific to zvk, should it be moved into RISCVInstrInfoVPseudos.td?

This revision was landed with ongoing or failed builds.Jul 13 2023, 11:39 AM
This revision was automatically updated to reflect the committed changes.
luke marked an inline comment as done.

LGTM as well.