[PATCH] D114799: [SLP]Improve vectorization of cmp instructions sequences.
Alexey Bataev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 30 15:03:48 PST 2021
ABataev added inline comments.
================
Comment at: llvm/test/Transforms/SLPVectorizer/X86/reduction-logical.ll:111
+; SSE-NEXT: [[S3:%.*]] = select i1 [[S2]], i1 [[TMP5]], i1 false
+; SSE-NEXT: ret i1 [[S3]]
+;
----------------
RKSimon wrote:
> ABataev wrote:
> > RKSimon wrote:
> > > Any idea what happened here?
> > The pair of `icmp slt` gets vectorized because the cost model decided that it is profitable. We can't handle these `select`s as reduction because `icmp` instructions have different predicates.
> But the sgt didn't get swapped and from the TODO at line 9298 I take it we can't do an altopcode/perdicate to handle the ult?
Sorry, don't quite understand your question. Why sgt is not vectorized with ult? They are not comptaible. Why sgt, ult and 2 slts are not vectorized? 3 different predicates and they are not profitabke for vectorization (ending up with 2 gather nodes). TODO is for extra analysis of cmp operands, to select only cmps with same/alternate operands only (!) or constants only(!).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114799/new/
https://reviews.llvm.org/D114799
More information about the llvm-commits
mailing list