[PATCH] D144670: [AArch64][GlobalISel] Legalize G_SHUFFLE_VECTOR with smaller dest size

Vladislav Dzhidzhoev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 24 06:15:29 PST 2023


dzhidzhoev marked an inline comment as not done.
dzhidzhoev added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:4993
 
-  // TODO: Normalize the shuffle vector since mask and vector length don't
-  // match.
-  if (MaskNumElts <= SrcNumElts) {
+  if (MaskNumElts == SrcNumElts) {
     return LegalizerHelper::LegalizeResult::UnableToLegalize;
----------------
paquette wrote:
> Add a TODO?
For the purpose of this function (making lengths of G_SHUFFLE_VECTOR instruction arguments equal), I think it should return Legalized if lengths are equal.


================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:4999
+    // undef values.
+    SmallVector<int, 8> NewMask(Mask);
+    for (unsigned I = MaskNumElts; I < SrcNumElts; ++I) {
----------------
paquette wrote:
> Why 8 vs default value for `SmallVector`?
This value is used in SelectionDAGBuilder::visitShuffleVector for the mask, that's why I used it here. Should I use the default value?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144670



More information about the llvm-commits mailing list