[PATCH] D102828: [GlobalISel] Implement splitting of G_SHUFFLE_VECTOR.

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 24 17:18:20 PDT 2021


arsenm accepted this revision.
arsenm added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:4234-4236
+  SmallVector<Register> SplitSrc1Regs, SplitSrc2Regs;
+  extractParts(Src1Reg, NarrowTy, 2, SplitSrc1Regs);
+  extractParts(Src2Reg, NarrowTy, 2, SplitSrc2Regs);
----------------
aemerson wrote:
> aemerson wrote:
> > arsenm wrote:
> > > It should be relatively easy to use extractGCDType + buildLCMMergePieces to form a widened vector for the non-power-of-2 case
> > I think for shuffle splitting, we should do what the DAG does here and insist on a power-of-2 size with `moreElementsToNextPow2`.
> IIRC the original intention of the legalizer rewrite was that the legalisation could be done in steps if needed, with the type as a direction to move towards.
> 
> It also seems cleaner to me to use the existing mechanism to handle further illegal operations than to duplicate that logic twice.
Legalization can be done in multiple steps, but I think the fewerElements would be considered one step (e.g. as a further step the scalars could be legalized)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102828/new/

https://reviews.llvm.org/D102828



More information about the llvm-commits mailing list