[all-commits] [llvm/llvm-project] 731bdc: [InstCombine] Add tests for folding (icmp eq/ne (a...

goldsteinn via All-commits all-commits at lists.llvm.org
Fri Oct 27 15:36:55 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 731bdcef2ef89201b77a86533245a8b4c96a2d7f
      https://github.com/llvm/llvm-project/commit/731bdcef2ef89201b77a86533245a8b4c96a2d7f
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-10-27 (Fri, 27 Oct 2023)

  Changed paths:
    A llvm/test/Transforms/InstCombine/icmp-and-add-sub-xor-p2.ll

  Log Message:
  -----------
  [InstCombine] Add tests for folding (icmp eq/ne (and (add/sub/xor A, P2), P2), 0/P2); NFC


  Commit: 0289dad538fa2fdc1a82a26f5d19f94fbd20d949
      https://github.com/llvm/llvm-project/commit/0289dad538fa2fdc1a82a26f5d19f94fbd20d949
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-10-27 (Fri, 27 Oct 2023)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/test/Transforms/InstCombine/icmp-and-add-sub-xor-p2.ll
    M llvm/test/Transforms/InstCombine/pr25342.ll
    M llvm/test/Transforms/PGOProfile/cspgo_profile_summary.ll

  Log Message:
  -----------
  [InstCombine] Add folds for (icmp eq/ne (and (add/sub/xor A, P2), P2), 0/P2)

- `(icmp eq/ne (and (add/sub/xor X, P2), P2), P2)`
    -> `(icmp eq/ne (and X, P2), 0)`
- `(icmp eq/ne (and (add/sub/xor X, P2), P2), 0)`
    -> `(icmp eq/ne (and X, P2), P2)`

Folds like this come up with reasonable regularity in odd/even loops.

Proofs: https://alive2.llvm.org/ce/z/45pq2x

Closes #67836


Compare: https://github.com/llvm/llvm-project/compare/8ceb72ffe575...0289dad538fa


More information about the All-commits mailing list