[flang] Lower elemental and transformational clean-up in HLFIR
In lowering to hlfir, no clean-up was added yet for the created hlfir.elemental. Add the needed hlfir.destroy. Regarding transformational lowering, clean-ups were created because they are lowered in memory, but this is inconvenient because this prevented lowering to hlfir from "moving" the created variable to an expression. Add a new entry point in IntrinsicCall.h that keeps track of whether or not the returned storage needs to be deallocated, but does not insert the deallocation in the StatementContext. This allows using the newly added hlfir.as_expr "move" aspect to be used and save creating a copy. Depends on D141839 Reviewed By: clementval Differential Revision: https://reviews.llvm.org/D141841
Loading
Please sign in to comment