[flang] Handle array constants of any rank
authorLeandro Lupori <leandro.lupori@linaro.org>
Tue, 16 May 2023 13:06:13 +0000 (13:06 +0000)
committerLeandro Lupori <leandro.lupori@linaro.org>
Mon, 22 May 2023 12:53:35 +0000 (09:53 -0300)
commite26e68a4905cc13064987c9b19fa153b54035d36
tree6f49b9ddb4dda1c63c04d499771a703e17cdde9b
parent231a6959025b3101942701b214c64762b55222c6
[flang] Handle array constants of any rank

Add support for representing array constants of any rank with MLIR
dense attribute. This greatly improves compile time and memory
usage of programs with large array constants. We still support only
arrays of a few basic types, such as integer, real and logic.

Fixes https://github.com/llvm/llvm-project/issues/60376

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D150686
flang/lib/Lower/ConvertConstant.cpp
flang/lib/Lower/ConvertVariable.cpp
flang/test/Lower/array.f90
flang/test/Lower/dense-array-any-rank.f90 [new file with mode: 0644]