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

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 17 14:28:22 PDT 2020


ABataev marked 8 inline comments as done.
ABataev added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:2593
   // Check that every instruction appears once in this bundle.
   SmallVector<unsigned, 4> ReuseShuffleIndicies;
   SmallVector<Value *, 4> UniqueValues;
----------------
RKSimon wrote:
> Should ReuseShuffleIndicies be SmallVector<int, 4> - and we then tag undefs with -1 (llvm::UndefMaskElem) ?
No, it won't work, need to register actual positions in `ReuseShuffleIndicies`, `-1` does not work here


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:3443
+  const unsigned NumOfInstructions =
+      llvm::count_if(InstructionsOnly, [](Value *V) { return true; });
+  Value *V0;
----------------
RKSimon wrote:
> can we use llvm::size(InstructionsOnly) ?
No, it does not work, `llvm::size` works only if it can be calculated in `O(1)`. Here it is not, since `InstructionsOnly` may have "holes".


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