[PATCH] D109645: [LV] Recognize intrinsic min/max reductions

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 13 13:31:16 PDT 2021


dmgreen added a comment.

In D109645#2998195 <https://reviews.llvm.org/D109645#2998195>, @spatel wrote:

> I didn't realize we were still missing vectorization of these intrinsics. What is the difference between the patterns here vs. the tests that are already vectorized in llvm/test/Transforms/LoopVectorize/intrinsic.ll ?

These ones are reductions (i.e https://godbolt.org/z/G9affdzsh, creating a llvm.vector.reduce.smax after the loop) as opposed to just plain vectorization (https://godbolt.org/z/K9jvT9rsv, which I believe are still working just fine). The code to match those reduction is what it changing here, requiring to look through the min/max intrinsics as opposed to a pair of icmp/select (which is actually a lot simpler, as you might imagine. The matching of reductions isn't the cleanest code in the world and I'm hoping that once min/max become canonical we can simplify it somewhat. At least in the meantime we have to match both though.)


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

https://reviews.llvm.org/D109645



More information about the llvm-commits mailing list