[PATCH] D63675: [InstCombine] Simplify icmp ult/uge (shl %x, C2), C1 iff C1 is power of two -> icmp eq/ne (and %x, (lshr -C1, C2)), 0.

Huihui Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 21 14:56:19 PDT 2019


huihuiz created this revision.
huihuiz added reviewers: lebedev.ri, efriedma.
huihuiz added a project: LLVM.
Herald added a subscriber: hiraditya.

Simplify 'shl' inequality test into 'and' equality test.

This pattern happens in the middle-end while simplifying bitfield access,
Exposed in https://reviews.llvm.org/D63505


Repository:
  rL LLVM

https://reviews.llvm.org/D63675

Files:
  llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
  llvm/test/Transforms/InstCombine/pr17827.ll
  llvm/test/Transforms/InstCombine/shl-and-unsigned-cmp-const.ll
  llvm/test/Transforms/InstCombine/shl-unsigned-cmp-const.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63675.206087.patch
Type: text/x-patch
Size: 12026 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190621/2ba14012/attachment.bin>


More information about the llvm-commits mailing list