[PATCH] D57059: [SLP] Initial support for the vectorization of the non-power-of-2 vectors.

Anton Afanasyev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 23 13:01:09 PST 2020


anton-afanasyev added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:2576
+          auto *It = llvm::find_if(UseEntry->Scalars, Instruction::classof);
+          if (It != UseEntry->Scalars.end()) {
+            Value *UseScalar = *It;
----------------
Could it be actually no one `Instruction` in `UseEntry` or should it be assert?


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:2580
+            // instructions. If that is the case, the one in Lane 0 will
+            // be used.
+            if (UseScalar != U ||
----------------
"Lane 0" seems outdated here, but not sure about better description.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:2726
+      llvm::count_if(VL, Instruction::classof);
+  if (NumberOfInstructions <= 1) {
+    LLVM_DEBUG(
----------------
`assert(NumberOfInstructions != 0 && "...")` and `if (NumberOfInstructions == 1)`?


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:3469
   }
-  if (I < E) {
+  // Gather if not all extracts are from the same vector/aggrgate.
+  if (I < End || (NElts < E && !all_of(drop_begin(VL, NElts), [](Value *V) {
----------------
Comment typo: `aggrgate`.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:4829
         if (getTreeEntry(PO))
-          ExternalUses.emplace_back(PO, cast<User>(VecPtr), 0);
-
-        NewLI = Builder.CreateAlignedLoad(VecTy, VecPtr, LI->getAlign());
+          ExternalUses.push_back(ExternalUser(PO, cast<User>(VecPtr), 0));
       } else {
----------------
`emplace_back()`


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:6238
+/// The first loop below simply finds all unused indices and then the next loop
+/// nest assigns these indeces for undef values positions.
+/// As an example below Order has two undef positions and they have assigned
----------------
typo: "indeces"


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D57059



More information about the llvm-commits mailing list