[Flang] Lower the sqrt intrinsics
authorKiran Chandramohan <kiran.chandramohan@arm.com>
Tue, 22 Mar 2022 14:13:52 +0000 (14:13 +0000)
committerKiran Chandramohan <kiran.chandramohan@arm.com>
Tue, 22 Mar 2022 15:05:21 +0000 (15:05 +0000)
commitfea20cb99087208d589d81bb7bbbc84198c7ffa4
treefe89fa8d54bdf993dc68274d30954acde64001fc
parent10fd2822b77e12215b4ea82fc6d0a052961eb9d9
[Flang] Lower the sqrt intrinsics

The intrinsic computes the square root for real and complex numbers. By
default they are lowered to runtime calls to libpgmath. With the llvm
option, it can be lowered to llvm intrinsics (not all types .eg. complex
are supported for llvm lowering).

This is part of the upstreaming effort from the fir-dev branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project

Reviewed By: schweitz

Differential Revision: https://reviews.llvm.org/D122018

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
flang/lib/Lower/IntrinsicCall.cpp
flang/test/Lower/llvm-math.f90
flang/test/Lower/sqrt.f90 [new file with mode: 0644]