[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:35:39 PDT 2021


ABataev added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:3740
+            auto *CI = cast<ConstantInt>(Op);
+            Operands.push_back(ConstantExpr::getIntegerCast(
+                CI, Ty, CI->getValue().isSignBitSet()));
----------------
RKSimon wrote:
> Could we end up in a situation where we end up truncating here and causing overflow problems later on?
This is what we already have when we're trying to build the vector for the GEPs. Here we end up with the IntPtr type. 


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:5715
+            Builder.CreateShuffleVector(Entries.front()->VectorizedValue,
                                         Entries.back()->VectorizedValue, Mask);
     } else {
----------------
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.


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