[PATCH] D126171: [InstCombine] fold icmp of zext bool based on limited range

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 22 10:56:36 PDT 2022


spatel created this revision.
spatel added a reviewer: nikic.
Herald added subscribers: hiraditya, mcrosier.
Herald added a project: All.
spatel requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Op0 <u (zext i1 X) --> Op0 == 0 && X

https://alive2.llvm.org/ce/z/avQDRY

This is a generalization of 4069cccf3b4ff4a <https://reviews.llvm.org/rG4069cccf3b4ff4afb743d3d371ead9e2d5491e3a> based on the post-commit suggestion. 
This also adds the i1 type check and tests that were missing from the earlier attempt; that commit caused several bot fails and was reverted.


https://reviews.llvm.org/D126171

Files:
  llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
  llvm/test/Transforms/InstCombine/icmp-range.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126171.431244.patch
Type: text/x-patch
Size: 5174 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220522/8c30cb7e/attachment.bin>


More information about the llvm-commits mailing list