[PATCH] D62818: [InstCombine] Introduce fold for icmp pred (and X, (sh signbit, Y)), 0.

Huihui Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 27 16:18:54 PDT 2019


huihuiz updated this revision to Diff 206958.
huihuiz added a comment.

for onehot_merge.ll
mathematically speaking

  (signbit l>> C)

is equivalent to

  (one l<< (bitwidth - C - 1))

In D63903 <https://reviews.llvm.org/D63903>, I update the test input, so that we are still checking fold for 'or' of ICmps and 'and' of ICmps.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D62818

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62818.206958.patch
Type: text/x-patch
Size: 12237 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190627/8455e6a7/attachment.bin>


More information about the llvm-commits mailing list