[all-commits] [llvm/llvm-project] c6a4fc: [ValueTracking] Determine assume KnownBits using C...

Nikita Popov via All-commits all-commits at lists.llvm.org
Wed Jul 5 05:00:21 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c6a4fc8ddfaf68d932b69b80a1efd0742fa8211a
      https://github.com/llvm/llvm-project/commit/c6a4fc8ddfaf68d932b69b80a1efd0742fa8211a
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-07-05 (Wed, 05 Jul 2023)

  Changed paths:
    M llvm/lib/Analysis/ValueTracking.cpp
    M llvm/test/Transforms/InstCombine/zext-or-icmp.ll

  Log Message:
  -----------
  [ValueTracking] Determine assume KnownBits using ConstantRange

For non-equality icmps, we don't do any KnownBits-specific
reasoning, and just use the known bits as a constraint on the range.
We can generalize this for all predicates by round-tripping through
ConstantRange and using makeAllowedICmpRegion().

The minor improvement in zext-or-icmp is because we assume that
a value is ult [0,1], which means it must be zero.




More information about the All-commits mailing list