[PATCH] D114198: [GlobalISel] Rework more/fewer elements for vectors
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 21 06:41:22 PST 2021
foad added inline comments.
================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:3665
+ if (!Ty.isVector()) {
+ if (!isNonVectorOp(NonVecOpIndices, OpIdx))
+ return false;
----------------
`is_contained(NonVecOpIndices, OpIdx)`
================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:6690
+ NumElts = Src0Ty.getNumElements();
+ if (Src0Ty.isVector()) {
+ extractParts(Src0Reg, EltTy, NumElts, Src0Regs);
----------------
This is the same condition as two lines above.
================
Comment at: llvm/lib/CodeGen/GlobalISel/Utils.cpp:938
+ LLT EltTy = OrigTy.getElementType();
+ return (NumElts == 1) ? EltTy : LLT::fixed_vector(NumElts, EltTy);
+}
----------------
arsenm wrote:
> I'm not sure what to do about scalable vectors, but no legalization has been added for those as far as I know
Can you use `LLT::scalarOrVector` here, or `OrigTy.changeElementCount`?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114198/new/
https://reviews.llvm.org/D114198
More information about the llvm-commits
mailing list