[all-commits] [llvm/llvm-project] d1511e: [InstCombine] adjust/add tests for cmp-of-signbits...

Sanjay Patel via All-commits all-commits at lists.llvm.org
Tue Jan 24 05:47:55 PST 2023


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

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

  Log Message:
  -----------
  [InstCombine] adjust/add tests for cmp-of-signbits; NFC

These were added with e76c95fb40b1081438 with the
right test names, but the predicates weren't updated
to match.


  Commit: 7cbfc39c77cafe925c0599ab121a67f94bf3870a
      https://github.com/llvm/llvm-project/commit/7cbfc39c77cafe925c0599ab121a67f94bf3870a
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2023-01-24 (Tue, 24 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

Test if 2 values have different or same signbits:
(X u>> BitWidth - 1) == zext (Y s> -1) --> (X ^ Y) < 0
(X u>> BitWidth - 1) != zext (Y s> -1) --> (X ^ Y) > -1

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

As noted in #60242, these patterns regressed between the
14.0 and 15.0 releases - probably due to a change in
canonicalization of related patterns.

The related patterns for testing if 2 values are both
pos/neg appear to be handled already.


Compare: https://github.com/llvm/llvm-project/compare/c97d3e5f68af...7cbfc39c77ca


More information about the All-commits mailing list