[all-commits] [llvm/llvm-project] 29f98d: [InstCombine] Fold bitwise logic with intrinsics (...

Yingwei Zheng via All-commits all-commits at lists.llvm.org
Wed Jan 10 03:33:33 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 29f98d6c25e237d311038ce225f0b3109925d400
      https://github.com/llvm/llvm-project/commit/29f98d6c25e237d311038ce225f0b3109925d400
  Author: Yingwei Zheng <dtcxzyw2333 at gmail.com>
  Date:   2024-01-10 (Wed, 10 Jan 2024)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
    M llvm/test/Transforms/InstCombine/bitreverse-known-bits.ll
    A llvm/test/Transforms/InstCombine/bitwiselogic-bitmanip.ll
    M llvm/test/Transforms/InstCombine/bswap-fold.ll

  Log Message:
  -----------
  [InstCombine] Fold bitwise logic with intrinsics (#77460)

This patch does the following folds:
```
bitwise(fshl (A, B, ShAmt), fshl(C, D, ShAmt)) -> fshl(bitwise(A, C), bitwise(B, D), ShAmt)
bitwise(fshr (A, B, ShAmt), fshr(C, D, ShAmt)) -> fshr(bitwise(A, C), bitwise(B, D), ShAmt)
bitwise(bswap(A), bswap(B)) -> bswap(bitwise(A, B))
bitwise(bswap(A), C) -> bswap(bitwise(A, bswap(C)))
bitwise(bitreverse(A), bitreverse(B)) -> bitreverse(bitwise(A, B))
bitwise(bitreverse(A), C) -> bitreverse(bitwise(A, bitreverse(C)))
```
Alive2: https://alive2.llvm.org/ce/z/iZN_TL




More information about the All-commits mailing list