[all-commits] [llvm/llvm-project] 9fb7a7: [InstCombine] Fold fcmp into select (#86482)

Yingwei Zheng via All-commits all-commits at lists.llvm.org
Tue Apr 23 04:35:38 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9fb7a736f0f893ffd5da3cebaed30bc91e6a8514
      https://github.com/llvm/llvm-project/commit/9fb7a736f0f893ffd5da3cebaed30bc91e6a8514
  Author: Yingwei Zheng <dtcxzyw2333 at gmail.com>
  Date:   2024-04-23 (Tue, 23 Apr 2024)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/test/Transforms/InstCombine/fcmp-select.ll
    M llvm/test/Transforms/InstCombine/select-select.ll

  Log Message:
  -----------
  [InstCombine] Fold fcmp into select (#86482)

This patch simplifies `fcmp (select Cond, C1, C2), C3` patterns in
ceres:
Alive2: https://alive2.llvm.org/ce/z/fWh_sD
```
define i1 @src(double %x) {
  %cmp1 = fcmp ord double %x, 0.000000e+00
  %sel = select i1 %cmp1, double 0xFFFFFFFFFFFFFFFF, double 0.000000e+00
  %cmp2 = fcmp oeq double %sel, 0.000000e+00
  ret i1 %cmp2
}

define i1 @tgt(double %x) {
  %cmp1 = fcmp uno double %x, 0.000000e+00
  ret i1 %cmp1
}

```



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