[PATCH] D148378: [SLP][NFC] Remove comparator argument of `tryToVectorizeSequence()`

Vasileios Porpodas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 14 14:41:49 PDT 2023


vporpo added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:14144
   bool Changed = false;
-  // Sort by type, parent, operands.
-  stable_sort(Incoming, Comparator);
----------------
ABataev wrote:
> ABataev wrote:
> > Would be good to add the assert that the array is properly sorted, but I don't know how to do it without comparator here.
> The general idea behind passing it as an argument was ensure that the incomming array is properly sorted, so we operate on potentially vectorizable lists instead of trying incompatible ones. So, it just allows do not forget about comparator for the new operations (e.g. math intrinsics calls).
Makes sense. I think we can use a common comparator function, let me see if it works.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148378



More information about the llvm-commits mailing list