[flang-commits] [PATCH] D134860: [flang] Add platform-specific intrinsic lowering
Slava Zakharin via Phabricator via flang-commits
flang-commits at lists.llvm.org
Thu Sep 29 08:44:56 PDT 2022
vzakhari added a comment.
In D134860#3823506 <https://reviews.llvm.org/D134860#3823506>, @jeanPerier wrote:
> I think doing this target specific dispatch in lowering is a bit early (MLIR/FIR passes relying on recognizing libm functions would also need to special case based on the target. Maybe I am wrong here though @vzakhari or @MatsPetersson may have a better view).
>
> I would rather suggest rewriting "hypotf" to "_hypotf" in https://github.com/flang-compiler/f18-llvm-project/blob/fir-dev/flang/lib/Optimizer/CodeGen/TargetRewrite.cpp if possible, although I understand it might be easier/cleaner from an implementation point of view to do it in IntrinsicCall.cpp. The runtime solution would also sounds fine to me.
Yes, I think having the late rewrite is a more consistent approach. Consider cases when we generate a Math dialect operation that is then converted to a libm call - if the callee does not have "default" name of a platform, we will have the same issue, but it will have to be resolved somewhere around `MathToLibm` convertor. So it seems a better approach is to have a dedicated platform-specific convertor for libm calls that will be applied to MLIR regardless of where the libm calls are coming from.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D134860/new/
https://reviews.llvm.org/D134860
More information about the flang-commits
mailing list