[flang] Use proper attributes for runtime calls with 'i1' arguments/returns.
authorSlava Zakharin <szakharin@nvidia.com>
Fri, 18 Nov 2022 20:08:02 +0000 (12:08 -0800)
committerSlava Zakharin <szakharin@nvidia.com>
Wed, 30 Nov 2022 19:51:34 +0000 (11:51 -0800)
commitd5b0de35bdd9a3f4d4a093e7938b06add34678eb
treefa5723a009258369ee0151e07c3182774d94360a
parent2fda6207118d1d1c19e3b66f615f332ffc2792d0
[flang] Use proper attributes for runtime calls with 'i1' arguments/returns.

Clang uses signext/zeroext attributes for integer arguments shorter than
the default 'int' type on a target. So Flang has to match this for functions
from Fortran runtime and also for BIND(C) routines. This patch implements
ABI adjustments only for Fortran runtime calls. BIND(C) part will be done
separately.

This resolves https://github.com/llvm/llvm-project/issues/58579

Differential Revision: https://reviews.llvm.org/D137050
flang/include/flang/Optimizer/Builder/Runtime/RTBuilder.h
flang/include/flang/Optimizer/Dialect/FIRDialect.h
flang/lib/Lower/IO.cpp
flang/lib/Lower/IntrinsicCall.cpp
flang/lib/Optimizer/CodeGen/Target.cpp
flang/lib/Optimizer/CodeGen/Target.h
flang/lib/Optimizer/CodeGen/TargetRewrite.cpp
flang/test/Fir/target-rewrite-integer.fir [new file with mode: 0644]