[all-commits] [llvm/llvm-project] f21a04: [InstCombine] Add tests for canonicalizing `(X^(X-...

goldsteinn via All-commits all-commits at lists.llvm.org
Fri Jul 21 12:15:30 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f21a042a8ceb7195ece0ad010703ebaeee9cfb68
      https://github.com/llvm/llvm-project/commit/f21a042a8ceb7195ece0ad010703ebaeee9cfb68
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-07-21 (Fri, 21 Jul 2023)

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

  Log Message:
  -----------
  [InstCombine] Add tests for canonicalizing `(X^(X-1)) u{ge,lt} X` as pow2 test; NFC

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


  Commit: 142f7448e770f25b774b058a7eab1f107c4daad9
      https://github.com/llvm/llvm-project/commit/142f7448e770f25b774b058a7eab1f107c4daad9
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-07-21 (Fri, 21 Jul 2023)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/test/Transforms/InstCombine/ispow2.ll

  Log Message:
  -----------
  [InstCombine] Canonicalize `(X^(X-1)) u{ge,lt} X` as pow2 test

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

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


  Commit: 5ca14d433e0a46023e59f21bfb4b20a674f0d799
      https://github.com/llvm/llvm-project/commit/5ca14d433e0a46023e59f21bfb4b20a674f0d799
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-07-21 (Fri, 21 Jul 2023)

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

  Log Message:
  -----------
  [InstCombine] Add tests for ispow2 comparisons with a known bit; NFC

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


  Commit: 413c119c6a812f91e480c4a67df512e340c41ff3
      https://github.com/llvm/llvm-project/commit/413c119c6a812f91e480c4a67df512e340c41ff3
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-07-21 (Fri, 21 Jul 2023)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/test/Transforms/InstCombine/ispow2.ll

  Log Message:
  -----------
  [InstCombine] If there is a known-bit transform is_pow2 check to just check for any other bits

in `ctpop(X) eq/ne 1` or `ctpop(X) ugt/ule 1`, if there is any
known-bit in `X`, instead of going through `ctpop`, we can just test
if there are any other known bits in `X`. If there are, `X` is not a
power of 2. If there aren't, `X` is a power of 2.

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

Reviewed By: nikic

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


Compare: https://github.com/llvm/llvm-project/compare/ccd78958f696...413c119c6a81


More information about the All-commits mailing list