[all-commits] [llvm/llvm-project] bdc068: [flang] Avoid invalid declare_value for promoted d...

Zhen Wang via All-commits all-commits at lists.llvm.org
Fri Jun 12 08:26:13 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bdc06892cdd37c0a52717373ad7774136ca72b63
      https://github.com/llvm/llvm-project/commit/bdc06892cdd37c0a52717373ad7774136ca72b63
  Author: Zhen Wang <zhenw at nvidia.com>
  Date:   2026-06-12 (Fri, 12 Jun 2026)

  Changed paths:
    M flang/lib/Optimizer/Dialect/FIROps.cpp
    M flang/test/Fir/mem2reg.mlir

  Log Message:
  -----------
  [flang] Avoid invalid declare_value for promoted dummy-scope variables (#202498)

This fixes a verifier failure in mem2reg after inlining a CUDA device
procedure. When a promoted FIR alloca had an associated fir.declare with
a dummy_scope, mem2reg could create a fir.declare_value at a loop header
where the original dummy scope did not dominate.

Skip creating block-argument fir.declare_value ops for such
declarations, matching the existing replaced-value handling. Add a FIR
mem2reg regression test for the loop-header block argument case.



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