[all-commits] [llvm/llvm-project] 8fb269: [InstCombine] add tests for smin/smax intrinsics w...

RotateRight via All-commits all-commits at lists.llvm.org
Tue Aug 17 05:16:29 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8fb269d94075c70b676ff8b7c8baf695cc66c74f
      https://github.com/llvm/llvm-project/commit/8fb269d94075c70b676ff8b7c8baf695cc66c74f
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-08-17 (Tue, 17 Aug 2021)

  Changed paths:
    M llvm/test/Transforms/InstCombine/minmax-intrinsics.ll

  Log Message:
  -----------
  [InstCombine] add tests for smin/smax intrinsics with negated ops; NFC


  Commit: d0975b7cb0e184e8e5f3975183c51937dfa4043a
      https://github.com/llvm/llvm-project/commit/d0975b7cb0e184e8e5f3975183c51937dfa4043a
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-08-17 (Tue, 17 Aug 2021)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
    M llvm/test/Transforms/InstCombine/minmax-intrinsics.ll

  Log Message:
  -----------
  [InstCombine] fold signed min/max intrinsics with negated operands

If both operands are negated, we can invert the min/max and do
the negation after:
smax (neg nsw X), (neg nsw Y) --> neg nsw (smin X, Y)
smin (neg nsw X), (neg nsw Y) --> neg nsw (smax X, Y)

This is visible as a remaining regression in D98152. I don't see
a way to generalize this for 'unsigned' or adapt Negator to
handle it. This only appears to be safe with 'nsw':
https://alive2.llvm.org/ce/z/GUy1zJ

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


  Commit: e73f4e11233323d66f1d47c4f8510f9bf812402d
      https://github.com/llvm/llvm-project/commit/e73f4e11233323d66f1d47c4f8510f9bf812402d
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-08-17 (Tue, 17 Aug 2021)

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

  Log Message:
  -----------
  [InstCombine] remove unused function argument; NFC


Compare: https://github.com/llvm/llvm-project/compare/fbae34635d83...e73f4e112333


More information about the All-commits mailing list