[PATCH] D129501: Redefine get.active.lane.mask to allow a more scalar lowering

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 12 10:49:25 PDT 2022


efriedma added inline comments.


================
Comment at: llvm/docs/LangRef.rst:19962
+numbers and not in machine numbers.  If ``%n`` unsigned less than ``%base``, then
+the result is a poison value. The above is equivalent to:
 
----------------
reames wrote:
> efriedma wrote:
> > A potential issue I see with this change is that it doesn't play well with unrolling in the vectorizer.  For example, if each iteration of a loop handles 8 elements at a time with vector width 4, you get two calls to llvm.get.active.lane.mask, I think.
> Can you expand on why this would be a problem?  I would expect to find the base incremented by the VF for the second unrolled copy, but that still has to be less than TC.
> 
> Hm, I'm assuming a loop with a scalar epilogue.  Is there maybe a problem here for tail folding?  I hadn't considered that, let me think a bit and get back to you.
I was thinking of something along the lines of tail folding, yes.  Or scenarios with mixed element types.

This is just from the general perspective of what constructs are useful for vectorization, though. I'm not deeply familiar with the exact loop forms LoopVectorizer generates at the moment.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129501



More information about the llvm-commits mailing list