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

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 17 18:55:51 PDT 2020


craig.topper added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:3443
+  const unsigned NumOfInstructions =
+      llvm::count_if(InstructionsOnly, [](Value *V) { return true; });
+  Value *V0;
----------------
ABataev wrote:
> 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".
Would using std::distance directly be more clear? You'd have to explicitly write begin()/end() though?


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