[PATCH] D158063: [GISel][AArch64] Combine G_BUILD_VECTOR(G_UNMERGE) with undef elements

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 16 02:57:27 PDT 2023


dmgreen created this revision.
dmgreen added reviewers: arsenm, aemerson, paquette, stuij, chuongg3.
Herald added a subscriber: kristof.beyls.
Herald added a project: All.
dmgreen requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

This extends the existing legalization combine to fold G_BUILD_VECTOR where the sources are all from the same G_UNMERGE, to handle cases where some of the lanes are undef. This comes up in the legalization of `<3 x ..>` vectors in AArch64, where they are padded with undef.

There are two choices for what to create. This patch generates an identity G_SHUFFLE_VECTOR with undef lanes marked as undef. This keeps the information about which lanes are undef, but the alternative would be to just reuse the source directly. I think both have advantages and disadvantages.


https://reviews.llvm.org/D158063

Files:
  llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
  llvm/test/CodeGen/AArch64/fabs.ll
  llvm/test/CodeGen/AArch64/fcvt.ll
  llvm/test/CodeGen/AArch64/fminimummaximum.ll
  llvm/test/CodeGen/AArch64/fminmax.ll
  llvm/test/CodeGen/AArch64/fpext.ll
  llvm/test/CodeGen/AArch64/fptrunc.ll
  llvm/test/CodeGen/AArch64/fsqrt.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158063.550678.patch
Type: text/x-patch
Size: 70996 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230816/a10a6db8/attachment.bin>


More information about the llvm-commits mailing list