[all-commits] [llvm/llvm-project] b98813: [InstCombine] add tests for cmp+select; NFC

Sanjay Patel via All-commits all-commits at lists.llvm.org
Wed Feb 8 14:26:13 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b98813fbb69751d95c7211784f0ca7735a935a36
      https://github.com/llvm/llvm-project/commit/b98813fbb69751d95c7211784f0ca7735a935a36
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2023-02-08 (Wed, 08 Feb 2023)

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

  Log Message:
  -----------
  [InstCombine] add tests for cmp+select; NFC


  Commit: 86b4d8645fc1b86693fef564cef68f24599c930f
      https://github.com/llvm/llvm-project/commit/86b4d8645fc1b86693fef564cef68f24599c930f
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2023-02-08 (Wed, 08 Feb 2023)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
    M llvm/test/Transforms/InstCombine/div-shift.ll
    M llvm/test/Transforms/InstCombine/select.ll

  Log Message:
  -----------
  [InstCombine] canonicalize cmp+select as umin/umax

(V == 0) ? 1 : V --> umax(V, 1)
(V == UMAX) ? UMAX-1 : V --> umin(V, UMAX-1)

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

This is one pair of the variants discussed in issue #60374.

Enhancements for the other end of the constant range and
signed variants are potential follow-ups, but that may
require more work because we canonicalize at least one
min/max like that to icmp+zext.


Compare: https://github.com/llvm/llvm-project/compare/71c7313f42d2...86b4d8645fc1


More information about the All-commits mailing list