[PATCH] D64275: [InstCombine] Generalize InstCombiner::foldAndOrOfICmpsOfAndWithPow2().

Huihui Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 5 20:54:57 PDT 2019


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

In the middle-end, (A & (signbit l>> K)) ==/!= 0 can be folded into
(A l<< K) s>=/s< 0.

When folding 'And' or 'Or' of ICmps, need to extend the iszero() check
of (A & (signbit l>> K)) to its equivalent form of (A l<< K) s>=/s< 0.


Repository:
  rL LLVM

https://reviews.llvm.org/D64275

Files:
  llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
  llvm/test/Transforms/InstCombine/onehot_merge.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64275.208251.patch
Type: text/x-patch
Size: 5756 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190706/f27fc025/attachment.bin>


More information about the llvm-commits mailing list