[all-commits] [llvm/llvm-project] b0bfef: [InstSimplify] fold redundant select of min/max, p...

Sanjay Patel via All-commits all-commits at lists.llvm.org
Sun Sep 25 04:14:51 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b0bfefb6ecbba8578d57efe9ab60d415ffc482be
      https://github.com/llvm/llvm-project/commit/b0bfefb6ecbba8578d57efe9ab60d415ffc482be
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-09-25 (Sun, 25 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, part 2

This extends e5d15e116292 to handle the inverse predicates
(there's probably a more elegant way to specify the preds).

These patterns correspond to the existing simplify:
max (min X, Y), X --> X
...and extra preds for (non)equality.

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/XMvEKQ
https://alive2.llvm.org/ce/z/QpMChr




More information about the All-commits mailing list