[PATCH] D89976: [ValueTracking] add range limits for ctpop

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 22 10:46:27 PDT 2020


spatel created this revision.
spatel added reviewers: davezarzycki, lebedev.ri, RKSimon.
Herald added subscribers: hiraditya, mcrosier.
Herald added a project: LLVM.
spatel requested review of this revision.

As discussed in D89952 <https://reviews.llvm.org/D89952>, instcombine can sometimes find a way to reduce similar patterns, but it is incomplete.
InstSimplify uses the computeConstantRange() ValueTracking analysis via simplifyICmpWithConstant(), so we just need to fill in the max value of ctpop to process any "icmp pred ctpop(X), C" pattern (the min value is initialized to zero automatically).


https://reviews.llvm.org/D89976

Files:
  llvm/lib/Analysis/ValueTracking.cpp
  llvm/test/Transforms/InstSimplify/compare.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89976.300041.patch
Type: text/x-patch
Size: 4204 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201022/193c5e78/attachment.bin>


More information about the llvm-commits mailing list