[PATCH] D78582: [InstCombine] substitute equivalent constant to reduce logic-of-icmps

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 22 08:38:25 PDT 2020


spatel updated this revision to Diff 259291.
spatel marked 2 inline comments as done.
spatel added a comment.

Patch updated:

1. Call SimplifyICmpInst() to determine if the transform truly requires a new instruction; if not, we do not need a hasOneUse() restriction.
2. Remove unlikely TODO comment.

The internal use of Simplify* here should make it possible to delete existing code in InstSimplify as discussed in D78430 <https://reviews.llvm.org/D78430> (and definitely makes the new code in that patch unnecessary unless I've missed some loophole).

Also with this patch applied, I did an audit of the existing AndOrOfICmps* logic by commenting out chunks of code and seeing if tests fail. Everything else is apparently still necessary; this patch does not provide a complete superset for anything else we do in InstCombine. So we can't delete anything from InstCombine in this patch.


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

https://reviews.llvm.org/D78582

Files:
  llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
  llvm/test/Transforms/InstCombine/and-or-icmp-min-max.ll
  llvm/test/Transforms/InstCombine/and-or-icmp-nullptr.ll
  llvm/test/Transforms/InstCombine/and-or-icmps.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78582.259291.patch
Type: text/x-patch
Size: 34711 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200422/b02c3996/attachment.bin>


More information about the llvm-commits mailing list