[PATCH] D142542: [InstSimplify] Simplify icmp between Shl instructions of the same value

Matt Devereau via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 15 03:37:18 PST 2023


MattDevereau updated this revision to Diff 497618.
MattDevereau marked 2 inline comments as done.
MattDevereau edited the summary of this revision.
MattDevereau added a comment.

@nikic I've precommited the tests, and added your alive examples to the description. I've changed the flag condition to `if (!NUW || (ICmpInst::isSigned(Pred) && !NSW)`to assert NUW for unsigned and NUW and NSW for signed. I've added two tests `neg_icmp_lshr_known_non_zero_slt_no_nuw` and `neg_icmp_lshr_known_non_zero_ult_no_nuw` which assert the correct flag conditions.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142542

Files:
  llvm/lib/Analysis/InstructionSimplify.cpp
  llvm/test/Transforms/InstSimplify/compare.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142542.497618.patch
Type: text/x-patch
Size: 5010 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230215/51f5f9a5/attachment.bin>


More information about the llvm-commits mailing list