This is an archive of the discontinued LLVM Phabricator instance.

[SVE][CodeGen] Add patterns for ADD/SUB + element count
ClosedPublic

Authored by kmclaughlin on Oct 8 2021, 9:49 AM.

Details

Summary

This patch adds patterns to match the following with INC/DEC:

  • @llvm.aarch64.sve.cnt[b|h|w|d] intrinsics + ADD/SUB
  • vscale + ADD/SUB

For some implementations of SVE, INC/DEC VL is not as cheap as ADD/SUB and
so this behaviour is guarded by the "use-scalar-inc-vl" feature flag, which for SVE
is off by default. There are no known issues with SVE2, so this feature is
enabled by default when targeting SVE2.

Diff Detail

Event Timeline

kmclaughlin created this revision.Oct 8 2021, 9:49 AM
kmclaughlin requested review of this revision.Oct 8 2021, 9:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 8 2021, 9:49 AM
Matt added a subscriber: Matt.Oct 8 2021, 2:37 PM
This revision is now accepted and ready to land.Oct 11 2021, 3:25 AM
sdesmalen added inline comments.Oct 11 2021, 6:15 AM
llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
1455

nit: indentation?

1466

nit: same indentation here and below.

llvm/lib/Target/AArch64/SVEInstrFormats.td
927

nit: indentation.

935

nit: indentation.

kmclaughlin marked 4 inline comments as done.
  • Fixed indentation in tablegen files
  • Updated the affected tests again after rebasing the patch
Allen added a subscriber: Allen.May 12 2022, 9:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 12 2022, 9:47 PM