[PATCH] D136922: [AMDGPU][GISel] Widen s16 SHUFFLE_VECTOR where there are no scalar pack insts

Pierre van Houtryve via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 28 01:13:33 PDT 2022


Pierre-vh created this revision.
Pierre-vh added a reviewer: arsenm.
Herald added subscribers: kosarev, foad, kerbowa, hiraditya, t-tye, tpr, dstuttard, yaxunl, jvesely, kzhuravl.
Herald added a project: All.
Pierre-vh requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

On targets where we don't have scalar pack insts, it's more efficient to first widen the SHUFFLE_VECTOR before lowering.  It avoids a bunch of useless bit-manipulation instructions.

This also:

- Fixes a small bug in the LegalizationArtefactCombiner that was exposed by this patch (a few tests were crashing because of it)
- Adds logic to the Legalizer so it can handle widening G_SHUFFLE_VECTORS


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D136922

Files:
  llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
  llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
  llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
  llvm/test/CodeGen/AMDGPU/GlobalISel/extractelement.i128.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/insertelement.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-shuffle-vector.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-shuffle-vector.s16.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136922.471429.patch
Type: text/x-patch
Size: 78109 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221028/cb3a3137/attachment.bin>


More information about the llvm-commits mailing list