[all-commits] [llvm/llvm-project] 28a5e6: [InstCombine] Remove over-generalization from comp...

Nikita Popov via All-commits all-commits at lists.llvm.org
Mon Nov 27 07:50:19 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 28a5e6b069ee7540cd0965a0ad6cf0475db8d68c
      https://github.com/llvm/llvm-project/commit/28a5e6b069ee7540cd0965a0ad6cf0475db8d68c
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-11-27 (Mon, 27 Nov 2023)

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

  Log Message:
  -----------
  [InstCombine] Remove over-generalization from computeKnownBitsFromCmp() (#72637)

For most practical purposes, the only KnownBits patterns we care about are
those involving a constant comparison RHS and constant mask. However,
the actual implementation is written in a very general way -- and of
course, with basically no test coverage of those generalizations.

This patch reduces the implementation to only handle cases with constant
operands. The test changes are all in "make sure we don't crash" tests.

The motivation for this change is an upcoming patch to handling dominating
conditions in computeKnownBits(). Handling non-constant RHS would add
significant additional compile-time overhead in that case, without any
significant impact on optimization quality.




More information about the All-commits mailing list