[all-commits] [llvm/llvm-project] a2609b: [ValueTracking] Checking haveNoCommonBitsSet for (...

Chuanqi Xu via All-commits all-commits at lists.llvm.org
Tue Feb 15 21:43:57 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a2609be0b284bfa55edf78e607eb426679cfea3d
      https://github.com/llvm/llvm-project/commit/a2609be0b284bfa55edf78e607eb426679cfea3d
  Author: Chuanqi Xu <yedeng.yd at linux.alibaba.com>
  Date:   2022-02-16 (Wed, 16 Feb 2022)

  Changed paths:
    M llvm/lib/Analysis/ValueTracking.cpp
    M llvm/test/Transforms/InstCombine/pr53357.ll
    M llvm/unittests/Analysis/ValueTrackingTest.cpp

  Log Message:
  -----------
  [ValueTracking] Checking haveNoCommonBitsSet for (x & y) and ~(x | y)

This one tries to fix:
https://github.com/llvm/llvm-project/issues/53357.

Simply, this one would check (x & y) and ~(x | y) in
haveNoCommonBitsSet. Since they shouldn't have common bits (we could
traverse the case by enumerating), and we could convert this one to (x &
y) | ~(x | y) . Then the compiler could handle it in
InstCombineAndOrXor.
Further more, since ((x & y) + (~x & ~y)) would be converted to ((x & y)
+ ~(x | y)), this patch would fix it too.

https://alive2.llvm.org/ce/z/qsKzRS

Reviewed By: spatel, xbolva00, RKSimon, lebedev.ri

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




More information about the All-commits mailing list