[PATCH] D43582: [SLP] Generalization of stores vectorization.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 5 10:44:42 PST 2018


ABataev added a comment.

In https://reviews.llvm.org/D43582#1027089, @spatel wrote:

> Someone more familiar with SLP should have a look at the diffs, but we need to address the compile-time question. 
>  The artificial limit is only there to guard against excessive compile-time cost, so do you have data to show that difference? Or does this patch solve the (potential) problem in another way?
>  More discussion here:
>  https://bugs.llvm.org/show_bug.cgi?id=17170


Just some theoretical thoughts. The complexity of the original implementation is O(n), while the complexity of the updated patch is O(n * log n);



================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:4598
   unsigned E = Stores.size();
-  IndexQueue.resize(E - 1);
+  const unsigned MaxLookDepth = std::max(E - 1, 16u);
+  SmallVector<unsigned, 16> IndexQueue(MaxLookDepth);
----------------
lebedev.ri wrote:
> The `std::max()` is not a typo? Might warrant a comment.
Yes, it is a typo, must be `min`, thanks!


Repository:
  rL LLVM

https://reviews.llvm.org/D43582





More information about the llvm-commits mailing list