Make it possible for math operations to be lowered in different ways on
different platforms. Use single precision hypot as a case study: on
most platforms, hypot can be lowered to hypotf. However, the MSVC
runtime is lacking a hypotf function and instead uses _hypotf (*).
This patch adds a platform check based on the FIR triple (which is
either the triple in the FIR module, or the system default triple) and
uses it to decide how to lower hypot.
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.
Alternatively we could just set a default lambda that returns true, and then we wouldn't need a helper to check for nullptr. I wasn't sure if people would consider that simpler and if it's worth going through a call every time, as opposed to a nullptr check in most cases.