[PATCH] D126686: [AArch64] Generate ADDP from shuffled add

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 31 00:55:00 PDT 2022


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

This adds a fold of `add(x, shuffle(x, <1,0,3,2,5,4,...>)`, into `shuffle(addp(x), <0,0,1,1,2,2,..>`. The ADDP instruction takes two vectors and returns one, adding adjacent pairs. So we match x in a custom combine as it is lowered from a v8i32. The original code would be 2 `rev64` and 2 `add`, with the new code being a single `addp` with a `zip1;zip2` shuffle, producing smaller code.


https://reviews.llvm.org/D126686

Files:
  llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
  llvm/lib/Target/AArch64/AArch64ISelLowering.h
  llvm/lib/Target/AArch64/AArch64InstrInfo.td
  llvm/test/CodeGen/AArch64/arm64-addp.ll
  llvm/test/CodeGen/AArch64/insert-extend.ll
  llvm/test/CodeGen/AArch64/reduce-shuffle.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126686.433027.patch
Type: text/x-patch
Size: 32306 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220531/28c55465/attachment.bin>


More information about the llvm-commits mailing list