[PATCH] D67411: [InstSimplify] simplifyUnsignedRangeCheck(): handle more cases (PR43251)

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 10 12:09:34 PDT 2019


lebedev.ri created this revision.
lebedev.ri added reviewers: spatel, nikic, xbolva00.
lebedev.ri added a project: LLVM.
Herald added a subscriber: hiraditya.

I don't have a direct motivational case for this,
but it would be good to have this for completeness/symmetry.

This pattern is basically the motivational pattern from
https://bugs.llvm.org/show_bug.cgi?id=43251
but with different predicate that requires that the offset is non-zero.

The completeness bit comes from the fact that a similar pattern (offset != zero)
will be needed for https://bugs.llvm.org/show_bug.cgi?id=43259,
so it'd seem to be good to not overlook very similar patterns..

Also, there is something odd with `isKnownNonZero()`, if the non-zero
knowledge was specified as an assumption, it didn't pick it up (PR43267)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D67411

Files:
  llvm/lib/Analysis/InstructionSimplify.cpp
  llvm/test/Transforms/InstSimplify/result-of-usub-by-nonzero-is-non-zero-and-no-overflow.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67411.219580.patch
Type: text/x-patch
Size: 7188 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190910/c7cda883/attachment.bin>


More information about the llvm-commits mailing list