[all-commits] [llvm/llvm-project] d9e927: [ConstantRange] Improve ConstantRange::binaryXor (...

Yingwei Zheng via All-commits all-commits at lists.llvm.org
Thu Feb 8 06:35:04 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d9e92765c5f9b0fa7adafa769dd13d37b6bca038
      https://github.com/llvm/llvm-project/commit/d9e92765c5f9b0fa7adafa769dd13d37b6bca038
  Author: Yingwei Zheng <dtcxzyw2333 at gmail.com>
  Date:   2024-02-08 (Thu, 08 Feb 2024)

  Changed paths:
    M llvm/lib/IR/ConstantRange.cpp
    A llvm/test/Transforms/SCCP/pr79696.ll
    M llvm/unittests/IR/ConstantRangeTest.cpp

  Log Message:
  -----------
  [ConstantRange] Improve ConstantRange::binaryXor (#80146)

`ConstantRange::binaryXor` gives poor results as it currently depends on
`KnownBits::operator^`.
Since `sub A, B` is canonicalized into `xor A, B` if `B` is the subset
of `A`, this patch reverts the transform in `ConstantRange::binaryXor`,
which will give better results.

Alive2: https://alive2.llvm.org/ce/z/bmTMV9
Fixes #79696.




More information about the All-commits mailing list