[PATCH] D81979: [AArch64][GlobalISel] Port buildvector -> dup pattern from AArch64ISelLowering

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 16 16:29:04 PDT 2020


paquette created this revision.
paquette added a reviewer: aemerson.
Herald added subscribers: danielkiss, hiraditya, kristof.beyls, rovka.
Herald added a project: LLVM.

Given this:

  %x:_(<n x sK>) = G_BUILD_VECTOR %lane, ...
  ...
  %y:_(<n x sK>) = G_SHUFFLE_VECTOR %x(<n x sK>), %foo, shufflemask(0, 0, ...)

We can produce:

  %y:_(<n x sK) = G_DUP %lane(sK)

as long as `%lane` is not a constant.

Doesn't seem to be too common, but AArch64ISelLowering attempts to do this before trying to produce a DUPLANE. Might as well port it.

Factor out the other G_DUP pattern into a helper function, and create a helper for this pattern.

Also make it so that when the splat has an undef mask, we try setting it to 0. SDAG does this, and it makes sure that when we get the build vector operand, we actually get a source operand.


https://reviews.llvm.org/D81979

Files:
  llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerCombiner.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/postlegalizer-combiner-shuffle-splat.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81979.271240.patch
Type: text/x-patch
Size: 8498 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200616/a6f363c8/attachment.bin>


More information about the llvm-commits mailing list