[flang] Enable target rewrite for int args/rets of bind(c) functions.
authorSlava Zakharin <szakharin@nvidia.com>
Wed, 8 Mar 2023 02:43:42 +0000 (18:43 -0800)
committerSlava Zakharin <szakharin@nvidia.com>
Wed, 8 Mar 2023 03:08:02 +0000 (19:08 -0800)
commit2c8d33897d90a6651842120805e28364c84c11a1
tree06685eb48fb03aa38b900d36e146facca2ce261b
parent3f29b23b1a3cd3e45b78fa62f7be5da5c7bb674b
[flang] Enable target rewrite for int args/rets of bind(c) functions.

BIND(C) subprograms must use the same target ABI as the C processor,
so 1/2-byte int args/rets must be rewritten to use signext attribute.
This change-set also sets fir.bindc_name for the math functions used
during lowering so that they can be fixed up as well (though, currently
none of them needs to be affected).

Differential Revision: https://reviews.llvm.org/D145537
flang/lib/Optimizer/Builder/IntrinsicCall.cpp
flang/lib/Optimizer/CodeGen/TargetRewrite.cpp
flang/test/Fir/target-rewrite-integer.fir
flang/test/Lower/math-lowering.f90