[all-commits] [llvm/llvm-project] 732021: [InstCombine] Optimize test for same-sign of values

Eric Gullufsen via All-commits all-commits at lists.llvm.org
Sun Jun 19 13:44:52 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 73202130e52e69d58c571c60163d1c8994e8d166
      https://github.com/llvm/llvm-project/commit/73202130e52e69d58c571c60163d1c8994e8d166
  Author: Eric Gullufsen <ericgullufsen at gmail.com>
  Date:   2022-06-19 (Sun, 19 Jun 2022)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
    M llvm/test/Transforms/InstCombine/and-or-icmps.ll

  Log Message:
  -----------
  [InstCombine] Optimize test for same-sign of values

(icmp slt (X & Y), 0) | (icmp sgt (X | Y), -1) -> (icmp sgt (X ^ Y), -1)
(icmp slt (X | Y), 0) & (icmp sgt (X & Y), -1) -> (icmp slt (X ^ Y), 0)

[[ https://alive2.llvm.org/ce/z/qXxEFP | alive2 example ]]
[[ https://godbolt.org/z/aWf9c6j74 | godbolt  ]]

[[ https://godbolt.org/z/5Ydn5TehY | godbolt for inverted form ]]
[[ https://alive2.llvm.org/ce/z/93AODr | alive2 for inverted form ]]
[[ https://github.com/llvm/llvm-project/issues/55988 | issue #55988 ]]

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




More information about the All-commits mailing list