The single precision hypot intrinsic is lowered to a call to the libm
hypotf function. However, the MSVC runtime lacks a hypotf function
and instead uses _hypotf (*). This patch tries to find and rewrite
calls to hypotf if we're on a MSVC platform.
Calls to libm functions can be introduced even after lowering (**).
Therefore, we try to do the rewriting at the very end of FIR to LLVM
lowering.
Fixes https://github.com/llvm/llvm-project/issues/57563
(*) More specifically, MSVC's headers define hypotf as an inline
function that just calls _hypotf. This works fine for clang, since it
will include those headers, but flang only links with the CRT so we
don't get a free ride.
Can you please combine this with the patterns/conversion above? I.e. add the MSVC conversion patterns into pattern and get rid of the separate applyPartialConversion below?