[PATCH] D120018: [AArch64] Alter mull shuffle(ext(..)) combine to work on buildvectors

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 17 01:09:10 PST 2022


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

We have a combine for converting `mul(dup(ext(..)), ...)` into `mul(ext(dup(..)), ..)`, for allowing more uses of smull and umull instructions. Currently it looks for vector insert and shuffle vectors to detect the element that we can convert to a vector extend. Not all cases will have a shufflevector/insert element though.

This started by extending the recognition to buildvectors (with elements that may be individually extended). The new method seems to cover all the cases that the old method captured though, as the shuffle will eventually be lowered to buildvectors, so the old method has been removed to keep the code a little simpler. The new code detects legal `build_vector(ext(a), ext(b), ..)`, converting them to `ext(build_vector(a, b, ..))` providing all the extends/types match up.

Found whilst looking at D96522 <https://reviews.llvm.org/D96522> / D118979 <https://reviews.llvm.org/D118979>.


https://reviews.llvm.org/D120018

Files:
  llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
  llvm/test/CodeGen/AArch64/aarch64-dup-ext.ll
  llvm/test/CodeGen/AArch64/aarch64-matrix-umull-smull.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120018.409514.patch
Type: text/x-patch
Size: 9290 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220217/6d357189/attachment.bin>


More information about the llvm-commits mailing list