[PATCH] D101555: [SLP]Improve handling of compensate external uses cost.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 18 13:41:47 PDT 2021


ABataev added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:2901
+        auto *I = cast<Instruction>(V);
+        if (!SourceVectors.contains(I)) {
+          ++NotUsedVectors;
----------------
RKSimon wrote:
> would this be better as a count_if ?
We do not need simple count here, we're filling list of operands and counting source vectors at the same time. Rather doubt count_if will help here


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:2921
 
-        TE->setOperand(1, VectorOperands);
+      ValueList VectorOperands;
+      for (Value *V : VL)
----------------
RKSimon wrote:
> Any good way to merge the SourceVectors set with the VectorOperands list?
Thought about it too, will try to improve it somehow


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101555



More information about the llvm-commits mailing list