[flang] Fold transformational bessels when host runtime has bessels
authorJean Perier <jperier@nvidia.com>
Fri, 22 Apr 2022 07:37:08 +0000 (09:37 +0200)
committerJean Perier <jperier@nvidia.com>
Fri, 22 Apr 2022 07:37:49 +0000 (09:37 +0200)
commit6c81b4a01e4956d70dac1a5733c063014e4fbe38
tree3f16edc3daae14d5cd6e7b735eb596d5cc7110ae
parent9687ca970f77ccb6b56ec05a4ccaf3cc94ec1655
[flang] Fold transformational bessels when host runtime has bessels

Transformational bessel intrinsic functions require the same math runtime
as elemental bessel intrinsics.

Currently elemental bessels could be folded if f18 was linked with pgmath
(cmake -DLIBPGMATH_DIR option). `j0`, `y0`, ... C libm functions were not
used because they are not standard C functions: they are Posix
extensions.

This patch enable:
- Using the Posix bessel host runtime functions when available.
- folding the transformational bessel using the elemental version.

Differential Revision: https://reviews.llvm.org/D124167
flang/lib/Evaluate/fold-real.cpp
flang/lib/Evaluate/intrinsics-library.cpp
flang/test/Evaluate/folding02.f90