[all-commits] [llvm/llvm-project] 0c4736: [InstCombine] Simplify nested selects with implied...

Yingwei Zheng via All-commits all-commits at lists.llvm.org
Mon Mar 4 22:11:48 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0c4736338596d6e527e286b7b551af4bb8b63a55
      https://github.com/llvm/llvm-project/commit/0c4736338596d6e527e286b7b551af4bb8b63a55
  Author: Yingwei Zheng <dtcxzyw2333 at gmail.com>
  Date:   2024-03-05 (Tue, 05 Mar 2024)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
    M llvm/test/Transforms/InstCombine/canonicalize-clamp-like-pattern-between-negative-and-positive-thresholds.ll
    M llvm/test/Transforms/InstCombine/nested-select.ll

  Log Message:
  -----------
  [InstCombine] Simplify nested selects with implied condition (#83739)

This patch does the following simplification:
```
sel1 = select cond1, X, Y 
sel2 = select cond2, sel1, Z
-->
sel2 = select cond2, X, Z if cond2 implies cond1
sel2 = select cond2, Y, Z if cond2 implies !cond1
```
Alive2: https://alive2.llvm.org/ce/z/9A_arU

It cannot be done in CVP/SCCP since we should guarantee that `cond2` is
not an undef.



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