[all-commits] [llvm/llvm-project] 42c326: [Flang][OpenMP] Fix assert trigger in MapInfoFinal...

agozillon via All-commits all-commits at lists.llvm.org
Tue May 5 09:41:31 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 42c326725df4c07553f3e2d59b44b5bac964f000
      https://github.com/llvm/llvm-project/commit/42c326725df4c07553f3e2d59b44b5bac964f000
  Author: agozillon <Andrew.Gozillon at amd.com>
  Date:   2026-05-05 (Tue, 05 May 2026)

  Changed paths:
    M flang/lib/Optimizer/OpenMP/MapInfoFinalization.cpp
    M flang/test/Lower/OpenMP/allocatable-dtype-intermediate-map-gen.f90
    M flang/test/Lower/OpenMP/derived-type-allocatable-map.f90
    A flang/test/Transforms/omp-map-info-finalization-member-record.fir
    M flang/test/Transforms/omp-map-info-finalization.fir
    A offload/test/offloading/fortran/target-map-nested-dtype-allocatable-member.f90

  Log Message:
  -----------
  [Flang][OpenMP] Fix assert trigger in MapInfoFinalization pass for implicit record member maps (#193851)

The current iteration of the implicit record member mapping segment of
the MapInfoFinalization pass makes the assumption that child maps of
parents are already bound to the targets block arguments, but that is
not the case apon initial lowering from PFT to MLIR. This actually
happens as the end of the MapInfoFinalization pass currently where we
"canonicalize" that all maps are inserted as Block arguments to their
respective targets.

This assumption unfortunately leads to a few cases where we trigger the
assertion, to address this we can impose this canonicalization of map
<-> block arguments as soon as we enter the pass and then once again at
the end of the pass for any new members generated by the
MapInfoFinalization pass. This allows the implicit record member mapping
process to continue unhindered whilst changing very little elsewhere
other than the ordering of block arguments (hence some lit tests
tweaks). The main downside is the extra processing required for running
the "canonialization" twice.

I adopted some tests created by @chichunchen in his version of the fix
to help test for regressions.

Co-authored-by: @chichunchen



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