[PATCH] D105986: [SLP]Improve vectorization of gathered loads.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 30 14:40:07 PDT 2021


ABataev added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:5715
+            Builder.CreateShuffleVector(Entries.front()->VectorizedValue,
                                         Entries.back()->VectorizedValue, Mask);
     } else {
----------------
ABataev wrote:
> RKSimon wrote:
> > By using .back() can't we safely use this for the Entries.size() == 1 case as well?
> I had trouble with it for an unknown reason, will check it once again.
Ahh, If I use `.back()` here, the compiler might emit something like this:
```
%vec = shuffle %v1, %v1, <0,1,2,undef>
```
I.e. the second argument is not replaced by the `PoisonValue` vector.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105986



More information about the llvm-commits mailing list