[PATCH] D117580: [LoopVectorize] Support conditional in-loop vector reductions

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 7 01:19:30 PST 2022


david-arm added a comment.

Hi @kmclaughlin, this looks great now, thanks for making the changes! I just had one comment about a test, but apart from that looks good. :)



================
Comment at: llvm/test/Transforms/LoopVectorize/reduction-inloop-cond.ll:341
+  %res = phi i32 [ %1, %if.then ], [ 3, %for.body ]
+  %and = and i32 %res, %rdx
+  %iv.next = add nuw nsw i64 %iv, 1
----------------
Hi @kmclaughlin, sorry to be a pain, but I just realised the `and` here is not actually conditional because it's always executed. I think this would also vectorise without your patch? Maybe it's worth moving the `and` instruction into the `if.then` block?


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

https://reviews.llvm.org/D117580



More information about the llvm-commits mailing list