[all-commits] [llvm/llvm-project] 641d16: [InstCombine] Fold umax(smax)/smin(umin) with non-...

Yingwei Zheng via All-commits all-commits at lists.llvm.org
Sun Feb 25 11:27:08 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 641d160ad236fb7a472a9eedbda2d62541e7dd0c
      https://github.com/llvm/llvm-project/commit/641d160ad236fb7a472a9eedbda2d62541e7dd0c
  Author: Yingwei Zheng <dtcxzyw2333 at gmail.com>
  Date:   2024-02-26 (Mon, 26 Feb 2024)

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

  Log Message:
  -----------
  [InstCombine] Fold umax(smax)/smin(umin) with non-negative constants (#82929)

This patch extends `reassociateMinMaxWithConstants` to fold the
following patterns:
```
umax (smax X, nneg C0), nneg C1 --> smax X, (umax C0, C1)
smin (umin X, nneg C0), nneg C1 --> umin X, (smin/umin C0, C1)
```
Alive2: https://alive2.llvm.org/ce/z/wfEj-e

Address the comment
https://github.com/llvm/llvm-project/pull/82472#pullrequestreview-1896922897.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list