[PATCH] D135174: [SLP]Redesign vectorization of the gather nodes.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 3 09:06:04 PDT 2022


ABataev added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:4009
 void BoUpSLP::reorderNodeWithReuses(TreeEntry &TE, ArrayRef<int> Mask) const {
   // For vectorized and non-clustered reused - just reorder reuses mask.
+  reorderReuses(TE.ReuseShuffleIndices, Mask);
----------------
RKSimon wrote:
> Split + update comments
The problem is that this part does not affect current vectorization, it works only with the redesigned version. Originally we do not use gather nodes for the vectorization, just the list of scalars to produce the buildvector. That's the reason I think this must be the part of this change.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:8129
+                              TE->UserTreeIndices.front().EdgeIdx == NodeIdx &&
+                              TE->UserTreeIndices.front().UserTE == E &&
+                              VE->isSame(TE->Scalars);
----------------
RKSimon wrote:
> We do this matching in a couple of places now - worth adding as a TreeEntry helper method?
Will try to do it in a separate patch.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:8200
+
+Value *BoUpSLP::createBuildVector(const TreeEntry *E) {
+  assert(E->State == TreeEntry::NeedToGather && "Expected gather node.");
----------------
RKSimon wrote:
> Add some comments describing whats happening in this method.
Will do


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135174



More information about the llvm-commits mailing list