[PATCH] D108049: [InstCombine] Canonicalize saturate with shift and xor to min/max clamp

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 31 12:47:10 PDT 2021


spatel added a comment.

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

> The problem with smaller intermediate folds is that the larger final fold
> may still be wanted iff the intermediate folds may be blocked due to the use counts..

Yes - that reminds me of the min/max pixel patterns from cmyk benchmarks. We ended up needing to match a larger-than-normal pattern to get those because of uses. (I'm trying to deal with the intrinsic versions of those patterns now to help D98152 <https://reviews.llvm.org/D98152>.)
So it depends on the motivating case here - if there are enough extra uses that we can't get the big pattern, then we might as well add this. If not, we can go for smaller matches and confirm that we get the sequence to work on the larger example(s).


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

https://reviews.llvm.org/D108049



More information about the llvm-commits mailing list