[PATCH] D122299: [InstCombine] Fix missing nsw flag when fold -(x-y) to y-x

chenglin.bi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 23 03:56:05 PDT 2022


bcl5980 added a comment.

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

> Must we do this? I was really hoping we wouldn't.
> Does this actually unblock some measurable improvement?
>
> Consider: https://alive2.llvm.org/ce/z/XYfMSm
> Both `sub`s have `NSW`, so i believe the code will now produce: https://alive2.llvm.org/ce/z/vUseE6

It comes from here https://reviews.llvm.org/D122013
Maybe we can enable it when IsTrulyNegation ? Abandon is also OK for me.


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

https://reviews.llvm.org/D122299



More information about the llvm-commits mailing list