[all-commits] [llvm/llvm-project] c8bc1a: [InstCombine] Add tests for cttz of lowest set bit...

Nikita Popov via All-commits all-commits at lists.llvm.org
Fri Jul 14 05:31:54 PDT 2023


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

  Changed paths:
    M llvm/test/Transforms/InstCombine/cttz.ll

  Log Message:
  -----------
  [InstCombine] Add tests for cttz of lowest set bit (NFC)


  Commit: dc2b2ae7dc333f9c3769785fa147c7872adb9bba
      https://github.com/llvm/llvm-project/commit/dc2b2ae7dc333f9c3769785fa147c7872adb9bba
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-07-14 (Fri, 14 Jul 2023)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
    M llvm/test/Transforms/InstCombine/cttz.ll
    M llvm/test/Transforms/InstCombine/select-ctlz-to-cttz.ll
    M llvm/test/Transforms/InstCombine/xor.ll

  Log Message:
  -----------
  [InstCombine] Fold cttz of lowest set bit

cttz(-a & a) is the same as cttz(a). -a & a is an idiom to extract
the lowest set bit, which naturally does not affect the number of
trailing zeroes.

Proof: https://alive2.llvm.org/ce/z/Yp26x7


Compare: https://github.com/llvm/llvm-project/compare/95075d3d2c66...dc2b2ae7dc33


More information about the All-commits mailing list