[PATCH] D98715: [LoopVectorize] Add support for scalable vectorization of induction variables

Christopher Tetreault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 19 09:48:00 PDT 2021


ctetreau added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:2536
           : VF.getKnownMinValue();
-  assert((!VF.isScalable() || Lanes == 1) &&
-         "Should never scalarize a scalable vector");
----------------
david-arm wrote:
> david-arm wrote:
> > ctetreau wrote:
> > > what happens in this case now? I see a bunch of branches that handle the case where Lanes is greater than 1, but nothing for when it equals 1.
> > When this equals 1 due to being uniform the loop below works fine I think - we just don't bother creating a whole vector for each Part. We only create the first lane instead, which works for both fixed-width and scalable vectors.
> > 
> > Are you specifically referring to the possibility of something like <vscale x 1 x Ty>? If so, perhaps you're right and we should still generate a whole vector for each part.
> Hi @ctetreau, I've changed the code to now check for:
> 
>   !IsUniform && VF.isScalable()
> 
> so that this is guaranteed to do something sensible for <vscale x 1 x ElTy> vectors as well.
Thanks.

Unfortunately, I'm quite busy with internal stuff right now, so I probably won't have time to review this closely.  If things calm down and this is still up, I'll try to take a closer look. However, if you get LGTM from somebody else feel free to just merge it.


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

https://reviews.llvm.org/D98715



More information about the llvm-commits mailing list