[llvm-bugs] [Bug 35091] New: AArch64 backend does not handle contract math.

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Oct 25 21:24:02 PDT 2017


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

            Bug ID: 35091
           Summary: AArch64 backend does not handle contract math.
           Product: libraries
           Version: 5.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: AArch64
          Assignee: unassignedbugs at nondot.org
          Reporter: yyc1992 at gmail.com
                CC: llvm-bugs at lists.llvm.org

Test case:

```
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
target triple = "aarch64-unknown-linux-gnu"

define double @f1(double, double, double) {
  %4 = call double @llvm.fmuladd.f64(double %0, double %1, double %2)
  ret double %4
}

define double @f2(double, double, double) {
  %4 = fmul contract double %0, %1
  %5 = fadd contract double %4, %2
  ret double %5
}

declare double @llvm.fmuladd.f64(double %a, double %b, double %c)
```

According to LangRef, the two function should be the same and should both use
fma or mul and add depending on what the backend think is faster. However,
running with `llc -O3` only the first one generates an fma instruction and the
second one uses a mul and an add.

ARM backend might have the same issue.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171026/e7ee299c/attachment.html>


More information about the llvm-bugs mailing list