[llvm] [SLP]Initial support for non-power-of-2 (but still whole register) number of elements in operands. (PR #107273)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 6 12:37:22 PDT 2024


================
@@ -11682,13 +11718,14 @@ BoUpSLP::isGatherShuffledEntry(
   if (TE == VectorizableTree.front().get())
     return {};
   // FIXME: Gathering for non-power-of-2 nodes not implemented yet.
-  if (TE->isNonPowOf2Vec())
+  if (TE->hasNonWholeRegisterElems(*TTI))
     return {};
   Mask.assign(VL.size(), PoisonMaskElem);
   assert(TE->UserTreeIndices.size() == 1 &&
          "Expected only single user of the gather node.");
-  assert(VL.size() % NumParts == 0 &&
-         "Number of scalars must be divisible by NumParts.");
+  // Number of scalars must be divisible by NumParts.
+  if (VL.size() % NumParts != 0)
----------------
preames wrote:

I'm reading over the existing NumParts code, and not sure I'm grasping what it's doing.  Is the idea to cost manual splitting of the vector to a smaller legal vector type?  If so, why is this not something that TTI should be doing internally?

https://github.com/llvm/llvm-project/pull/107273


More information about the llvm-commits mailing list