[PATCH] D112562: [SLP]Fix logical and/or reductions.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 26 13:57:56 PDT 2021


ABataev added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:8019
+        return Builder.CreateSelect(LHS, Builder.getTrue(), RHS, Name);
+      LLVM_FALLTHROUGH;
     case RecurKind::And:
----------------
spatel wrote:
> RKSimon wrote:
> > I'm not sure if I like the double fallthrough tbh, and I'd expect static analyzers to warn about the repeated if() - are adding extra 'return Builder.CreateBinOp' that bad?
> Yes - we already have that structure for min/max below here, so we might as well do the same for these cases.
Will fix it, no problem


================
Comment at: llvm/test/Transforms/SLPVectorizer/X86/reduction-logical.ll:477
 
 define i1 @logical_and_icmp_extra_op(<4 x i32> %x, <4 x i32> %y, i1 %c) {
 ; CHECK-LABEL: @logical_and_icmp_extra_op(
----------------
spatel wrote:
> We should also have a 'logical-or' test so we have coverage for that path.
Ok, will add


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112562



More information about the llvm-commits mailing list