[all-commits] [llvm/llvm-project] e17dde: [InstSimplify] Generalize `simplifyAndOrOfFCmps` (...

Yingwei Zheng via All-commits all-commits at lists.llvm.org
Wed Feb 7 23:07:46 PST 2024


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

  Changed paths:
    M llvm/lib/Analysis/InstructionSimplify.cpp
    M llvm/test/Transforms/InstCombine/create-class-from-logic-fcmp.ll
    M llvm/test/Transforms/InstSimplify/logic-of-fcmps.ll

  Log Message:
  -----------
  [InstSimplify] Generalize `simplifyAndOrOfFCmps` (#81027)

This patch generalizes `simplifyAndOrOfFCmps` to simplify patterns like:
```
define i1 @src(float %x, float %y) {
  %or.cond.i = fcmp ord float %x, 0.000000e+00
  %cmp.i.i34 = fcmp olt float %x, %y
  %cmp.i2.sink.i = and i1 %or.cond.i, %cmp.i.i34
  ret i1 %cmp.i2.sink.i
}

define i1 @tgt(float %x, float %y) {
  %cmp.i.i34 = fcmp olt float %x, %y
  ret i1 %cmp.i.i34
}
```
Alive2: https://alive2.llvm.org/ce/z/9rydcx

This patch and #80986 will fix the regression introduced by #80941.
See also the IR diff
https://github.com/dtcxzyw/llvm-opt-benchmark/pull/199#discussion_r1480974120.




More information about the All-commits mailing list