[PATCH] D149742: [SLP]Improve isGatherShuffledEntry by trying per-register shuffle.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 23 14:13:50 PDT 2023


ABataev added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:7255
+           InVectors.back().get<const TreeEntry *>() == E2) ||
+          (!E2 && InVectors.size() >= 1 &&
+           InVectors.front().get<const TreeEntry *>() == &E1)) {
----------------
vdmitrie wrote:
> vdmitrie wrote:
> > InVectors.size() >=1  is same as  !InVectors.empty()
> > 
> > Having this check assumes that InVectors can be empty here, but at the same time InVectors.front() below (at line 7267) assumes it is not empty. So which one  is the right assumption?
> > InVectors.size() >=1  is same as  !InVectors.empty()
> > 
> > Having this check assumes that InVectors can be empty here, but at the same time InVectors.front() below (at line 7267) assumes it is not empty. So which one  is the right assumption?
> 
> What about the assumption?  I believe "!InVectors.empty()" is always true. That is why I asked the question about assumption.  This method is called twice in the patch and both have early return when InVectors is empty. 
Yes, this check can be dropped here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149742



More information about the llvm-commits mailing list