[all-commits] [llvm/llvm-project] e10c3b: [InstCombine] add one-use check for min/max fold w...

RotateRight via All-commits all-commits at lists.llvm.org
Thu Aug 19 05:43:05 PDT 2021


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

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

  Log Message:
  -----------
  [InstCombine] add one-use check for min/max fold with not operands; NFC

This makes the intrinsic logic match the cmp+select idiom folds
just below. It's not clearly a win either way unless we think
that a 'not' op costs more than min/max.

The cmp+select folds on these patterns are more extensive than
the intrinsics currently and may have some complicated interactions,
so I'm trying to make those line up and bring the optimizations
for intrinsics up to parity.


  Commit: 610d3d512aad6f737e932d31c1a207f0a58cd0c0
      https://github.com/llvm/llvm-project/commit/610d3d512aad6f737e932d31c1a207f0a58cd0c0
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-08-19 (Thu, 19 Aug 2021)

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

  Log Message:
  -----------
  [InstCombine] add tests for min/max with inverts; NFC


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

  Changed paths:
    M llvm/include/llvm/Transforms/InstCombine/InstCombiner.h
    M llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
    M llvm/test/Transforms/InstCombine/minmax-intrinsics.ll

  Log Message:
  -----------
  [InstCombine] add min/max intrinsics as freely invertible candidates

In the optimized test, we are able to peak through the
min/max that has 2 min/max operands and invert them all:
https://alive2.llvm.org/ce/z/7gYMN5


Compare: https://github.com/llvm/llvm-project/compare/77579b99e9ce...eee0ded3371f


More information about the All-commits mailing list