[PATCH] D122077: [InstCombine] Fold (ctpop(X) == 1) | (X == 0) into ctpop(X) < 2

Hirochika Matsumoto via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 26 11:04:40 PDT 2022


hkmatsumoto updated this revision to Diff 418405.
hkmatsumoto added a comment.

Reflect code reviews

      

- Move all added tests to ispow2.ll from icmp-or.ll since now that they

contain tests for "and" operand

- Add tests to confirm extra uses don't affect the optimization

- Add negative tests whose order of the op/and operand being swapped

(named *_swap_cmp)

- Add negative tests for wrong predicates

- Test various wrong constants


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122077

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122077.418405.patch
Type: text/x-patch
Size: 18481 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220326/f24360bd/attachment.bin>


More information about the cfe-commits mailing list