[all-commits] [llvm/llvm-project] 3f4faa: [InstCombine] add tests for cmp-of-signbits using ...

Sanjay Patel via All-commits all-commits at lists.llvm.org
Thu Jan 26 05:59:04 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3f4faa790fe683446313090a0d1147d5fb9e0979
      https://github.com/llvm/llvm-project/commit/3f4faa790fe683446313090a0d1147d5fb9e0979
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2023-01-26 (Thu, 26 Jan 2023)

  Changed paths:
    M llvm/test/Transforms/InstCombine/icmp-shr.ll

  Log Message:
  -----------
  [InstCombine] add tests for cmp-of-signbits using sext+ashr; NFC

These are copied from the zext+lshr variants from:
e76c95fb40b108
d1511ed8d19ac


  Commit: 2d7bb6066722d894591360464608698e9125bdff
      https://github.com/llvm/llvm-project/commit/2d7bb6066722d894591360464608698e9125bdff
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2023-01-26 (Thu, 26 Jan 2023)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp

  Log Message:
  -----------
  [InstCombine] improve description of not+shift transform; NFC

This was added recently with:
e44a305690add9f75


  Commit: 0ef7cbc319ee6488a47fda1b45b0d7170722df31
      https://github.com/llvm/llvm-project/commit/0ef7cbc319ee6488a47fda1b45b0d7170722df31
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2023-01-26 (Thu, 26 Jan 2023)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/test/Transforms/InstCombine/icmp-shr.ll

  Log Message:
  -----------
  [InstCombine] reduce compare of signbits of 2 values, signed variant

(X s>> BitWidth - 1) == sext (Y s> -1) --> (X ^ Y) < 0
(X s>> BitWidth - 1) != sext (Y s> -1) --> (X ^ Y) > -1

This is the same logic as:
7cbfc39c77ca
...extended to deal with "signed" cast+shift instructions.

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


Compare: https://github.com/llvm/llvm-project/compare/6bc9b15e695c...0ef7cbc319ee


More information about the All-commits mailing list