[flang] Inline array size call when dim is compile time constant
authorRazvan Lupusoru <rlupusoru@nvidia.com>
Thu, 11 May 2023 17:42:37 +0000 (10:42 -0700)
committerRazvan Lupusoru <rlupusoru@nvidia.com>
Thu, 11 May 2023 21:50:43 +0000 (14:50 -0700)
commit036549fc6c7cb9ecddd82c1401a2b50882a219f7
tree52c79b849825ae863687a929ba86ace95ec39e05
parente19387e6936c9ccc6200b32f3affea7b1020664c
[flang] Inline array size call when dim is compile time constant

Instead of calling _FortranASizeDim, we can instead load extent
directly from descriptor. Add this support for cases where dim
is a known constant at compile time.

Reviewed By: clementval

Differential Revision: https://reviews.llvm.org/D150385
flang/lib/Optimizer/Builder/IntrinsicCall.cpp
flang/test/Lower/Intrinsics/ubound.f90