[flang] Use proper attributes for runtime calls with 'i1' arguments/returns.
authorSlava Zakharin <szakharin@nvidia.com>
Sat, 28 Jan 2023 02:14:00 +0000 (18:14 -0800)
committerSlava Zakharin <szakharin@nvidia.com>
Mon, 30 Jan 2023 23:39:59 +0000 (15:39 -0800)
commitff794116f9815979f9a3a1195aff9be49334da7a
tree580e5a0cd704be39aab64875c519ee89eb28a94c
parent7d626e7cbb3ac9b3f43a10df8d8edfab1300b156
[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/D142677
flang/include/flang/Optimizer/Builder/Runtime/RTBuilder.h
flang/include/flang/Optimizer/Dialect/FIRDialect.h
flang/lib/Lower/IO.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]