[flang] Use tdesc on fir.embox in code generation
authorValentin Clement <clementval@gmail.com>
Wed, 26 Oct 2022 12:16:43 +0000 (14:16 +0200)
committerValentin Clement <clementval@gmail.com>
Wed, 26 Oct 2022 12:17:00 +0000 (14:17 +0200)
commit2e978986560750a87e0c880106ca0c5f421f05d2
tree208ad8f017d15ca10ab3a58d7de9ce37b9bd0068
parent11c1d8b7fd82b32b37db47bcd8eac813b9667b5c
[flang] Use tdesc on fir.embox in code generation

For polymoprhic entities, the type descriptor is dynamic. The tdesc
operand on fir.embox is meant to propagate the dynamic type when
embox a polymorphic entity.
This patch makes use of this operand in code generation and update
the created descriptor accordingly.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D136748
flang/include/flang/Optimizer/CodeGen/CGOps.td
flang/include/flang/Optimizer/Dialect/FIROps.td
flang/lib/Optimizer/CodeGen/CodeGen.cpp
flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp
flang/test/Fir/convert-to-llvm.fir
flang/test/Lower/allocatable-polymorphic.f90