2 Commits

Author SHA1 Message Date
jeanPerier
539dbfcfcf
[flang][fir] add fir.is_assumed_size codegen (#93953)
Lower to IsAssumedSize runtime call in `--fir-assumed-rank-op` pass.
2024-06-03 17:14:03 +02:00
jeanPerier
f1d13bbd66
[flang] add FIR to FIR pass to lower assumed-rank operations (#93344)
Add pass to lower assumed-rank operations. The current patch adds
codegen for fir.rebox_assumed_rank. It will be the pass lowering
fir.select_rank.
    
fir.rebox_assumed_rank is lowered to a call to CopyAndUpdateDescriptor
runtime API.
    
Note that the lowering ends-up allocating two new descriptors at the
LLVM level (one alloca created by the pass for the CopyAndUpdateDescriptor
result descriptor argument, the second one is created by the fir.load
of the result descriptor in codegen).
LLVM is currently unable to properly optimize and merge those allocas.
The "nocapture" attribute added to CopyAndUpdateDescriptor arguments
gives part of the information to LLVM, but the fir.load codegen of
descriptors must be updated to use llvm.memcpy instead of
llvm.load+store to allow LLVM to optimize it. This will be done in later patch.
2024-05-27 11:45:39 +02:00