[PATCH] D88287: [NARY-REASSOCIATE] Support reassociation of min/max

Evgeniy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 2 00:32:52 PST 2021


ebrevnov added a comment.

In D88287#2596538 <https://reviews.llvm.org/D88287#2596538>, @lebedev.ri wrote:

> I don't think we should reinvent SCEV Expander.
> I was looking at fixing this properly, but got sidetracked by having to first fix the `isHighCostExpansion()`.

I tried to adjust SCEV Expander but it's pretty challenging by itself. The reason is it should support not only integer types but floating point and pointer types as well. For example, for floating point types changing "cmp" and "select" pair to related intrinsic may potentially change the semantics for corner cases like NANs, INFs, exceptions, etc...

I'm not saying that enhancing SCEV Expander is definitely wrong way to go. It's pretty challenging and can potentially take long time. I think these two should not be mixed. Once SCEV Expander is reworked it will be a trivial change in reassociation pass to employ it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88287



More information about the llvm-commits mailing list