[PATCH] D63505: [InstCombine] Fold icmp eq/ne (and %x, ~C), 0 -> %x u</u>= 0 earlier, C+1 is power of 2.

Huihui Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 18 11:19:19 PDT 2019


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

To generate simplified IR, make sure fold

  (X & ~C) ==/!= 0 --> X u</u>= C+1

is scheduled before fold

  ((X << Y) & C) == 0 -> (X & (C >> Y)) == 0.


Repository:
  rL LLVM

https://reviews.llvm.org/D63505

Files:
  llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
  llvm/test/Transforms/InstCombine/lshr-and-negC-icmpeq-zero.ll
  llvm/test/Transforms/InstCombine/shl-and-negC-icmpeq-zero.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63505.205403.patch
Type: text/x-patch
Size: 9791 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190618/3c0d2b0a/attachment.bin>


More information about the llvm-commits mailing list