[PATCH] D95690: [LoopVectorize] improve IR fast-math-flags propagation in reductions

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 3 06:31:04 PST 2021


spatel added a comment.

In D95690#2538567 <https://reviews.llvm.org/D95690#2538567>, @asbirlea wrote:

> Here's what the test reduced to. To reproduce run `opt -passes='loop-vectorize' test.ll` with the assert in place.

Thanks! I see what happened - we speculatively assume that we matched a reduction pattern based on the cmp only. So in this example, we are trying to match an integer smax recurrence before checking that the subsequent `select` is actually part of a valid integer min/max pattern. The logic is confusing, but I'm not sure how to improve it yet. Hopefully, the complexity all goes away when we canonicalize to min/max intrinsics. I added a slightly modified version of the test, so we don't fall into the same bug again:
916c4121c1 <https://reviews.llvm.org/rG916c4121c10bc39b51754c3ac2483317568a4856>


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95690



More information about the llvm-commits mailing list