[PATCH] D63060: [InstCombine] usub.sat(a, b) + b => umax(a, b) (PR42178)

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 07:12:05 PDT 2019


lebedev.ri added a comment.

In D63060#1555522 <https://reviews.llvm.org/D63060#1555522>, @xbolva00 wrote:

> Thanks for answer. 
>  This comment:
>  “The transform is not correct, because it increases the number of uses of A. If A is undef, it may evaluate to a different value for each use :(“
>
> Why this is issue  ? since we can check if A is undef


Not really, if `isa<undef>(a)` fires, then that would have been constant-folded away before it gets here https://godbolt.org/z/JcknUp
And if it didn't fire, it doesn't mean that `a` is guaranteed to not be undef.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D63060





More information about the llvm-commits mailing list