[all-commits] [llvm/llvm-project] c36095: [InstCombine] Canonicalize ((X & -X) - 1) --> (~X ...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Wed Aug 24 07:31:48 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c360955c4804e9b25017372cb4c6be7adcb216ce
      https://github.com/llvm/llvm-project/commit/c360955c4804e9b25017372cb4c6be7adcb216ce
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2022-08-24 (Wed, 24 Aug 2022)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
    M llvm/test/Transforms/InstCombine/add-mask-neg.ll
    M llvm/test/Transforms/InstCombine/ctpop-cttz.ll

  Log Message:
  -----------
  [InstCombine] Canonicalize ((X & -X) - 1) --> (~X & (X - 1)) (PR51784)

Enables the ctpop((x & -x ) - 1) -> cttz(x, false) fold

Alive2: https://alive2.llvm.org/ce/z/EDk4h7 (((X & -X) - 1) --> (~X & (X - 1)) )

Alive2: https://alive2.llvm.org/ce/z/8Yr3XG (CTPOP -> CTTZ)

Fixes #51126

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




More information about the All-commits mailing list