[PATCH] D67332: [InstSimplify] simplifyUnsignedRangeCheck(): if we know that X != 0, handle more cases (PR43246)
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 8 12:49:40 PDT 2019
lebedev.ri marked an inline comment as done.
lebedev.ri added inline comments.
================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:1399-1406
+ // X <= Y && Y != 0 --> Y <= X iff X != 0
+ // X <= Y || Y != 0 --> Y != 0 iff X != 0
+ if (UnsignedPred == ICmpInst::ICMP_ULE && EqPred == ICmpInst::ICMP_NE &&
+ isKnownNonZero(X, DL))
+ return IsAnd ? UnsignedICmp : ZeroICmp;
+
+ // X > Y && Y == 0 --> Y == 0 iff X != 0
----------------
Ehh, i messed up comments here
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D67332/new/
https://reviews.llvm.org/D67332
More information about the llvm-commits
mailing list