[flang][codegen] ensure descriptor lower bounds are LBOUND compliant
authorJean Perier <jperier@nvidia.com>
Fri, 25 Mar 2022 08:02:48 +0000 (09:02 +0100)
committerJean Perier <jperier@nvidia.com>
Fri, 25 Mar 2022 08:02:57 +0000 (09:02 +0100)
commitd3bc3a0400414a5c71cc029fa42272d647e3b81b
tree550367480fe201ad3292112130603e8b38e17126
parent7f1adbaba99512d5fbf45ec54585b41218535836
[flang][codegen] ensure descriptor lower bounds are LBOUND compliant

Follow-up of https://reviews.llvm.org/D121488 to ensure all descriptors
created inline complies with LBOUND requirement that the lower bound is
`1` when the related dimension extent is zero.

Both fir.xrebox and fir.xembox codegen is updated to enforce this
constraint.

Also upstream the "normalized lower bound" attribute that was added in fir-dev
since embox codegen was upstreamed, it is conflicting with this patch
otherwise.

Differential Revision: https://reviews.llvm.org/D122419
flang/include/flang/Optimizer/Dialect/FIROps.h
flang/lib/Optimizer/CodeGen/CodeGen.cpp
flang/test/Fir/convert-to-llvm.fir