aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
diff options
context:
space:
mode:
authorSlava Zakharin <szakharin@nvidia.com>2023-04-28 08:50:55 -0700
committerSlava Zakharin <szakharin@nvidia.com>2023-04-28 08:51:11 -0700
commit8df5913250d55883feb8fa46a838c93a77c2e291 (patch)
tree7a0136dbfba45b27d7e36b7fb5978d427134bb0d /llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
parent6db45cc4bc279370b93fc6ef58d0cb87dd7f552f (diff)
downloadllvm-8df5913250d55883feb8fa46a838c93a77c2e291.zip
llvm-8df5913250d55883feb8fa46a838c93a77c2e291.tar.gz
llvm-8df5913250d55883feb8fa46a838c93a77c2e291.tar.bz2
[flang][hlfir] Fixed length-one assignment.
Assignment from a character dummy argument to a length-one character variable resulted in illegal fir.convert: %0 = fir.load %unboxed_dummy : !fir.ref<!fir.char<1,?>> %1 = fir.convert %0 : (!fir.char<1,?>) -> !fir.char<1> fir.store %1 to %local : !fir.ref<!fir.char<1>> This change fixes the length-one assignment code to use proper casts. For character dummy arguments with constant length we will now also type cast the unboxed reference to the character type with constant length during the lowering: fir.convert %x : (!fir.ref<!fir.char<1,?>>) -> !fir.ref<!fir.char<1,8>> I also adjusted the length-one assignment recognition so that in case of same-length assignment we recognize length-one from either LHS or RHS data types. Reviewed By: jeanPerier Differential Revision: https://reviews.llvm.org/D149382
Diffstat (limited to 'llvm/lib/Transforms/Utils/BasicBlockUtils.cpp')
0 files changed, 0 insertions, 0 deletions