[PATCH] D19501: Add LoadStoreVectorizer pass

Alina Sbirlea via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 23 17:15:55 PDT 2016


asbirlea added inline comments.

================
Comment at: lib/Transforms/Vectorize/LoadStoreVectorizer.cpp:538
@@ +537,3 @@
+    if (Tails.count(Head))
+      continue;
+
----------------
As I understand it, this is the condition for finding the chain of maximum length. The check that Head cannot be found in Tails, means it's the beginning of a chain, hence one of the longest chains. However, if the longest chain fails to vectorize, this same check prevents any vectorization of the remaining chain.

Here's a suggestion to address vectorizing the chain suffix:
```
for (int i = 0; i < Heads.size(); i++) {
    unsigned Head = Heads[i];
    if (VectorizedValues.count(Instrs[Head]))
      continue;
    // Skip if a longer chain exists in the remaining Heads/Tails
    for (int j = i+1; j < Tails.size(); j++)
      if (Head == Tails[j])
        continue;
```
Feel free to add additional improvements for vectorization of a chain prefix.


http://reviews.llvm.org/D19501





More information about the llvm-commits mailing list