[flang] Use libm functions for complex operations by default
authorDavid Truby <david@truby.dev>
Fri, 14 Jul 2023 16:02:44 +0000 (17:02 +0100)
committerDavid Truby <david@truby.dev>
Wed, 19 Jul 2023 13:34:38 +0000 (14:34 +0100)
commit3681a7dd7818aa93956fe42d37e97da6882f23ae
tree791595c8a10cc65c5b895a2d64a8ba0052300a5f
parent6cf8bde056f3ff58bde54dbe3b320d81ad5d66d6
[flang] Use libm functions for complex operations by default

This patch changes the default lowering for complex operations to use
the more accurate libm operations as opposed to the mlir complex
operations. This is necessary due to precision issues in the mlir
complex dialect that cause failures in e.g. the LAPACK tests.

The mlir complex dialect lowering will still be used when
`-fapprox-func` is set (and by extension `-ffast-math` and `-Ofast`)

Differential Revision: https://reviews.llvm.org/D155310
flang/lib/Optimizer/Builder/IntrinsicCall.cpp
flang/test/Lower/HLFIR/binary-ops.f90
flang/test/Lower/Intrinsics/abs.f90
flang/test/Lower/Intrinsics/exp.f90
flang/test/Lower/Intrinsics/log.f90
flang/test/Lower/math-lowering.f90
flang/test/Lower/power-operator.f90
flang/test/Lower/sqrt.f90
flang/test/Lower/trigonometric-intrinsics.f90