[flang-commits] [flang] [flang][Transforms] Add `SelectOpsConversion` pass (PR #212977)

Kareem Ergawy via flang-commits flang-commits at lists.llvm.org
Thu Jul 30 06:57:35 PDT 2026


================
@@ -76,6 +76,22 @@ def AffineDialectDemotion : Pass<"demote-affine", "::mlir::func::FuncOp"> {
   ];
 }
 
+def SelectOpsConversion : Pass<"fir-select-ops-conversion"> {
+  let summary = "Lower fir.select / fir.select_case / fir.select_rank to cf.*";
+
+  let description = [{
+    Lowers FIR multi-way branch terminators to control-flow dialect ops
+    (`cf.switch`, `cf.cond_br`, `cf.br`), keeping the same CFG shape (block
----------------
ergawy wrote:

Compared to the old LLVM targeting patterns. But indeed no need to add that since these patterns will be removed in any case.

https://github.com/llvm/llvm-project/pull/212977


More information about the flang-commits mailing list