[all-commits] [llvm/llvm-project] 748ecc: [ValueTracking] add range limits for ctpop

RotateRight via All-commits all-commits at lists.llvm.org
Fri Oct 23 05:18:52 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 748ecc6b326082c72f5d0866fd7cae499516c079
      https://github.com/llvm/llvm-project/commit/748ecc6b326082c72f5d0866fd7cae499516c079
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2020-10-23 (Fri, 23 Oct 2020)

  Changed paths:
    M llvm/lib/Analysis/ValueTracking.cpp
    M llvm/test/Transforms/InstSimplify/compare.ll

  Log Message:
  -----------
  [ValueTracking] add range limits for ctpop

As discussed in 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).

Differential Revision: https://reviews.llvm.org/D89976




More information about the All-commits mailing list