[llvm] [SLP] Initial vectorization of non-power-of-2 ops. (PR #77790)
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 8 03:34:51 PST 2024
================
@@ -10661,7 +10704,16 @@ template <typename BVTy, typename ResTy, typename... Args>
ResTy BoUpSLP::processBuildVector(const TreeEntry *E, Args &...Params) {
assert(E->State == TreeEntry::NeedToGather && "Expected gather node.");
unsigned VF = E->getVectorFactor();
-
+ BVTy ShuffleBuilder(Params...);
+ // FIXME: Only full gathering is implemented for non-power-of-2 nodes at the
+ // moment.
+ if (E->isNonPowOf2Vec()) {
+ Value *BV = ShuffleBuilder.gather(E->Scalars);
+ SmallVector<int> Mask(VF, PoisonMaskElem);
+ std::iota(Mask.begin(), Mask.end(), 0);
+ ShuffleBuilder.add(BV, Mask);
+ return ShuffleBuilder.finalize(std::nullopt);
+ }
----------------
alexey-bataev wrote:
Again, why do you need special processing for non-power-of-2? It would be good, if you could try to adjust this whole function to support it. May help in future for the major non-power-of-2 functionality.
https://github.com/llvm/llvm-project/pull/77790
More information about the llvm-commits
mailing list