[all-commits] [llvm/llvm-project] eb4544: [InstSimplify] add tests for select with min/max o...

Sanjay Patel via All-commits all-commits at lists.llvm.org
Sat Sep 24 08:35:01 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: eb454433f49ce27144e3db2f5b6f0b013b050a30
      https://github.com/llvm/llvm-project/commit/eb454433f49ce27144e3db2f5b6f0b013b050a30
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-09-24 (Sat, 24 Sep 2022)

  Changed paths:
    A llvm/test/Transforms/InstSimplify/select-maxmin.ll

  Log Message:
  -----------
  [InstSimplify] add tests for select with min/max op; NFC

These are organized as 10 (predicates) * 4 (swapped operands) * 4 (min/max variants) = 160 tests.


  Commit: e5d15e11629274c105be1c67ff51d7ed10cfbcb7
      https://github.com/llvm/llvm-project/commit/e5d15e11629274c105be1c67ff51d7ed10cfbcb7
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-09-24 (Sat, 24 Sep 2022)

  Changed paths:
    M llvm/lib/Analysis/InstructionSimplify.cpp
    M llvm/test/Transforms/InstSimplify/select-maxmin.ll

  Log Message:
  -----------
  [InstSimplify] fold redundant select of min/max

This is similar to the existing simplify:
max (max X, Y), X --> max X, Y
...but the select condition can be one of
several predicates as shown in the tests.

The tests cycle through all 10 icmp preds for
each min/max variant with 4 swapped operand
patterns each (and the min/max operands are
commuted in every other test within those).

Some Alive2 examples to verify:
https://alive2.llvm.org/ce/z/lCAQm4
https://alive2.llvm.org/ce/z/kzxVXC


Compare: https://github.com/llvm/llvm-project/compare/e07ead85a368...e5d15e116292


More information about the All-commits mailing list