[flang-commits] [flang] [Flang][HLFIR] Lower PACK(array, .TRUE.) to hlfir.reshape (PR #213603)

via flang-commits flang-commits at lists.llvm.org
Tue Aug 11 03:08:01 PDT 2026


ejose02 wrote:

> Thank you for the updates.
> 
> Why did you decide to convert directly to `hlfir.elemental` instead of converting to `hlfir.reshape`? I think for the code cleanliness and maintainability sake we'd better convert to `hlfir.reshape` and then let the other conversion pattern handle it.

I've switched back to emitting hlfir.reshape and letting ReshapeAsElementalConversion handle the copy. SHAPE is built as !hlfir.expr<1xi32> via a small elemental, with the extent product computed in index.

https://github.com/llvm/llvm-project/pull/213603


More information about the flang-commits mailing list