[flang][hlfir] Lower vector subscripted RHS designators
Lower vector subscripted designators as values when they appear outside of the assignment left-hand side and input IO contexts. This matches Fortran semantics where vector subscripted designators cannot be written to outside of the two contexts mentioned above: they are passed/taken by value where they appear. This patch uses the added hlfir.element_addr to lower vector designators in lowering. But when reaching the end of the designator lowering, the hlfir.element_addr is turned into an hlfir.elemental when lowering is not asking for the hlfir.elemental_addr. This approach allows lowering vector subscripted in the same way in while visiting the designator, and only adapt to the context at the edge. The part where lowering uses the hlfir.elemental_addr will be done in further patch as it requires lowering assignments in the new hlfir.region_assign op, and there is not codegen yet for these new operations. Differential Revision: https://reviews.llvm.org/D149480
Loading
Please register or sign in to comment