[flang] Shift argument attributes when result operand is inserted
authorValentin Clement <clementval@gmail.com>
Fri, 19 Aug 2022 06:40:09 +0000 (08:40 +0200)
committerValentin Clement <clementval@gmail.com>
Fri, 19 Aug 2022 06:40:27 +0000 (08:40 +0200)
commit5dbeb2ce2a8c73016a7e1a5f0e049469239e74c7
tree8f2f2dc375822e6194ce82437960e056a2c1ba8f
parente351e8213bf342a8d78bb7655beca832ce871acd
[flang] Shift argument attributes when result operand is inserted

The TargetRewrite pass convert the signature of the function.
In some cases it adds operands to the function to hanlde the result of it.
This patch makes sure the argument attributes present before the conversion
are replaced with the correct arguments after the conversion is performed.

Depends D132113

Reviewed By: vdonaldson

Differential Revision: https://reviews.llvm.org/D132114
flang/lib/Optimizer/CodeGen/TargetRewrite.cpp
flang/test/Fir/target-rewrite-arg-position.fir