https://bugs.llvm.org/show_bug.cgi?id=49831

            Bug ID: 49831
           Summary: Missing FP optimization opportunities for fcmp ord
                    operations
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedb...@nondot.org
          Reporter: juneyoung....@sf.snu.ac.kr
                CC: llvm-bugs@lists.llvm.org

; Excerpted from llvm/test/Transforms/InstCombine/and-fcmp.ll

```
$ cat src.ll
define i1 @PR41069_commute_logical(i1 %z, float %c, float %d) {
  %ord1 = fcmp ninf ord float %c, 0.0
  %and = select i1 %ord1, i1 %z, i1 false
  %ord2 = fcmp ninf reassoc ord float %d, 0.0
  %r = select i1 %ord2, i1 %and, i1 false
  ret i1 %r
}
```

This can be optimized to
```
  %c.fr = freeze float %c
  %ord1 = fcmp ord float %c.fr, %d
  %r = select i1 %ord1, i1 %z, i1 false
```

Alive2 link: https://alive2.llvm.org/ce/z/QfkJak

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to