[PATCH] D91655: [AArch64][GlobalISel] Fix crash during legalization of a vector G_SELECT with scalar mask.
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 17 12:18:13 PST 2020
arsenm added inline comments.
================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:6226
+ MaskElt = MIRBuilder.buildSExt(DstTy.getElementType(), MaskElt).getReg(0);
+ // Generate a vector splat idiom to be pattern matched later.
+ auto UndefVec = MIRBuilder.buildUndef(DstTy);
----------------
Maybe should have a buildSplat helper too
================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:6231-6233
+ SmallVector<int, 16> ZeroMask;
+ for (int I = 0; I < DstTy.getNumElements(); ++I)
+ ZeroMask.push_back(0);
----------------
This is the same as the ZeroMask(DstTy.getNumElements())
================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:6235-6238
+ auto ShufSplat = MIRBuilder
+ .buildInstr(TargetOpcode::G_SHUFFLE_VECTOR, {DstTy},
+ {InsElt, UndefVec})
+ .addShuffleMask(MaskAlloc);
----------------
We should have a buildShuffleVector
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91655/new/
https://reviews.llvm.org/D91655
More information about the llvm-commits
mailing list