Convert fir.select_type operation to an if-then-else ladder.
The type guards are sorted before the conversion so it follows the
execution of SELECT TYPE construct as mentioned in 11.1.11.2 point 4
of the Fortran standard.
Depends on D138279
Paths
| Differential D138280
[flang] Add fir.select_type conversion to if-then-else ladder ClosedPublic Authored by clementval on Nov 18 2022, 2:44 AM.
Details Summary Convert fir.select_type operation to an if-then-else ladder. Depends on D138279
Diff Detail
Event Timeline
Comment Actions Looks great, the class is ordering into a list to get the desired semantics is neat ! My main comment is that I think you might need to check if a type is an ancestor rather than a direct parent while doing this ordering.
Comment Actions One more question, otherwise looks great.
This revision is now accepted and ready to land.Nov 21 2022, 12:47 AM
Closed by commit rG06b4ce66d831: [flang] Add fir.select_type conversion to if-then-else ladder (authored by clementval). · Explain WhyNov 21 2022, 1:01 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 476821 flang/include/flang/Optimizer/Transforms/Passes.td
flang/lib/Optimizer/Dialect/FIROps.cpp
flang/lib/Optimizer/Dialect/FIRType.cpp
flang/lib/Optimizer/Transforms/ControlFlowConverter.cpp
flang/test/Lower/select-type.f90
|
Is looking at the first parent name enough ?
What if you have class is with some type t3 and a classis with its grand parent t1, but not the parent t2 ? :