[PATCH] D125111: [SLP] Make reordering aware of external vectorizable scalar stores.

Vasileios Porpodas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 6 18:37:02 PDT 2022


vporpo added a comment.

@vdmitrie please let me know if you find a stability issue, I will do more testing on my side too.



================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:4131
+    for (StoreInst *SI : StoresVec) {
+      unsigned Idx = llvm::find(StoresVecSorted, SI) - StoresVecSorted.begin();
+      ReorderIndices.push_back(Idx);
----------------
vdmitrie wrote:
> std::distance(StoresVecSorted.begin(), find(StoresVecSorted, SI));
Hmm why is it preferable over `operator-()`? `StoresVecSorted` is a `SmallVector`, it should implement a random access iterator.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125111



More information about the llvm-commits mailing list