[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>
Fri, 18 Nov 2022 20:52:57 +0000 (12:52 -0800)
commit396ead93e3cead59727947afdea1fc2b49f0fc34
treeb3f371ec5dcf2ee100c6418292cb51b11692176f
parent3fb08d14a63f5f745d3fec2b5f6ffef4cf0a398c
[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]