[all-commits] [llvm/llvm-project] 688be0: [flang][CodeGen] Replace fir.select* FIR-to-LLVM p...

Kareem Ergawy via All-commits all-commits at lists.llvm.org
Thu Jul 30 23:12:17 PDT 2026


  Branch: refs/heads/users/ergawy/lower-fir-switch-to-cf-2
  Home:   https://github.com/llvm/llvm-project
  Commit: 688be0bb50243e2ca071738bf6109f1cd54eab41
      https://github.com/llvm/llvm-project/commit/688be0bb50243e2ca071738bf6109f1cd54eab41
  Author: ergawy <kareem.ergawy at gmail.com>
  Date:   2026-07-30 (Thu, 30 Jul 2026)

  Changed paths:
    M flang/lib/Optimizer/CodeGen/CodeGen.cpp
    M flang/test/Fir/Todo/select_case_with_character.fir
    M flang/test/Fir/convert-to-llvm-invalid.fir
    M flang/test/Fir/convert-to-llvm.fir

  Log Message:
  -----------
  [flang][CodeGen] Replace fir.select* FIR-to-LLVM patterns with stubs

`fir.select`, `fir.select_case`, `fir.select_rank`, and `fir.select_type`
are lowered to cf.* earlier in the pipeline (`--fir-select-ops-conversion`
and `--fir-polymorphic-op`). Their FIR-to-LLVM conversion patterns are
dead in a correct pipeline. Replace them with a single templated stub
`SelectShouldHaveBeenConvertedStub<OP>` that emits `"'fir.<op>' op should
have already been converted"` and fails legalization, so running
`--fir-to-llvm-ir` standalone on stale IR reports a clear diagnostic
instead of "unable to legalize".

`Fir/convert-to-llvm.fir`'s six select* test blocks are removed (the
lowering no longer runs; CF-level coverage lives in
`Fir/SelectOpsConversion/`). `Fir/convert-to-llvm-invalid.fir` gains a
stub-error test per op. `Fir/Todo/select_case_with_character.fir` is
retargeted to check the equivalent diagnostic now emitted by
`--fir-select-ops-conversion`.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply at anthropic.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list