[PATCH] D157187: [InstCombine] Propagate the nsw for instruction neg-sub

Allen zhong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 7 06:03:19 PDT 2023


Allen updated this revision to Diff 547754.
Allen marked an inline comment as done.
Allen retitled this revision from "[InstCombine] Propagate the nuw/nsw for instruction neg-sub" to "[InstCombine] Propagate the nsw for instruction neg-sub".
Allen added a comment.
Herald added a reviewer: lebedev.ri.
Herald added a subscriber: lebedev.ri.

address comments
1、don't propagate the nuw because it seems pretty useless to boot (**sub nuw 0, %x** can only be non-poison if %x is zero)
2、Reconstructed in negation according to suggestions
3、Add the new negative test **neg_and_shl_sub**


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

https://reviews.llvm.org/D157187

Files:
  llvm/lib/Transforms/InstCombine/InstCombineNegator.cpp
  llvm/test/Transforms/InstCombine/abs-intrinsic.ll
  llvm/test/Transforms/InstCombine/nsw.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157187.547754.patch
Type: text/x-patch
Size: 6318 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230807/22e08284/attachment.bin>


More information about the llvm-commits mailing list