[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:28:22 PDT 2022


bcl5980 updated this revision to Diff 417552.
bcl5980 added a comment.

Only neg is nsw also can createNSWSub
Neg by sub 0 case:
https://alive2.llvm.org/ce/z/KZLr8T
https://alive2.llvm.org/ce/z/lHJc-f
https://alive2.llvm.org/ce/z/pgH3Wd
https://alive2.llvm.org/ce/z/ZwVCtN

Neg by mul -1 case:
https://alive2.llvm.org/ce/z/BwMPtA
https://alive2.llvm.org/ce/z/Vn4pjh
https://alive2.llvm.org/ce/z/rYSowr
https://alive2.llvm.org/ce/z/fA587w


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

https://reviews.llvm.org/D122299

Files:
  llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
  llvm/lib/Transforms/InstCombine/InstCombineInternal.h
  llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
  llvm/lib/Transforms/InstCombine/InstCombineNegator.cpp
  llvm/test/Transforms/InstCombine/nsw.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122299.417552.patch
Type: text/x-patch
Size: 7209 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220323/be58d6f6/attachment.bin>


More information about the llvm-commits mailing list