[fir] Add fir.select_case conversion
authorValentin Clement <clementval@gmail.com>
Thu, 11 Nov 2021 14:00:18 +0000 (15:00 +0100)
committerValentin Clement <clementval@gmail.com>
Thu, 11 Nov 2021 14:00:51 +0000 (15:00 +0100)
commit39f4ef81463d66779ea3430bd3a95284fe34b6bf
treecf49b03e20d540400d1c4bb05700fada557e86ff
parent9534e361ea12aaecde52b8ac4c947f9a301d0c9b
[fir] Add fir.select_case conversion

The `fir.select_case` operation is converted to a if-then-else ladder.

Conversion of `fir.select_case` operation with character is not
implemented yet.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: kiranchandramohan, mehdi_amini

Differential Revision: https://reviews.llvm.org/D113484

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
flang/include/flang/Optimizer/Dialect/FIROps.td
flang/lib/Optimizer/CodeGen/CodeGen.cpp
flang/lib/Optimizer/Dialect/FIROps.cpp
flang/test/Fir/convert-to-llvm-invalid.fir
flang/test/Fir/convert-to-llvm.fir