[PATCH] D108049: [InstCombine] Extend canonicalizeClampLike to handle truncated inputs

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 16 02:17:02 PDT 2021


dmgreen added a comment.

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

> Here's what i wanted to see: https://alive2.llvm.org/ce/z/2XpHkB
> Did i mess that proof up, or are some new preconditions needed?

Oh I see. It appears to need a check that the C0 in `icmp ult %a, C0` isn't zero, to prevent undef being an issue, unless I got this wrong:
https://alive2.llvm.org/ce/z/Fxjsv6
Same thing for the original case:
https://alive2.llvm.org/ce/z/BBdqhZ

It sounds fine to me to assume that the icmp ult %a, 0 will have already been simplified away, but let me know if you think an extra check should be added in case.


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

https://reviews.llvm.org/D108049



More information about the llvm-commits mailing list