[PATCH] D123386: [AArch64] Add lane moves to PerfectShuffle tables

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 8 06:17:21 PDT 2022


dmgreen created this revision.
dmgreen added reviewers: SjoerdMeijer, labrinea, samtebbs, jaykang10.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a project: All.
dmgreen requested review of this revision.
Herald added a project: LLVM.

This teaches the perfect shuffle tables about lane inserts, that can help reduce the cost of many entries. Many of the shuffle masks are one-away from being correct, and a simple lane move can be a lot simpler than trying to use ext/zip/etc.  Because they are not exactly like the other masks handled in the perfect shuffle tables, they require special casing to generate them, with a special InsOp Operator.

The lane to insert into is encoded as the RHSID, and the move from is grabbed from the original mask. This helps reduce the maximum perfect shuffle entry cost to 3, with many more shuffles being generatable in a single instruction.


https://reviews.llvm.org/D123386

Files:
  llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
  llvm/lib/Target/AArch64/AArch64PerfectShuffle.h
  llvm/test/Analysis/CostModel/AArch64/shuffle-other.ll
  llvm/test/CodeGen/AArch64/arm64-dup.ll
  llvm/test/CodeGen/AArch64/arm64-rev.ll
  llvm/test/CodeGen/AArch64/insert-extend.ll
  llvm/test/CodeGen/AArch64/neon-bitwise-instructions.ll
  llvm/test/CodeGen/AArch64/neon-wide-splat.ll
  llvm/test/CodeGen/AArch64/select-shuffle.ll
  llvm/test/CodeGen/AArch64/shuffle-tbl34.ll
  llvm/test/CodeGen/AArch64/shuffles.ll
  llvm/utils/PerfectShuffle/PerfectShuffle.cpp



More information about the llvm-commits mailing list