[all-commits] [llvm/llvm-project] c9fb37: [flang][FIR] add fir.assumed_size_extent to abstra...

jeanPerier via All-commits all-commits at lists.llvm.org
Wed Oct 22 02:46:40 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c9fb37c75f741f1179f2d2c661d27d36645b0310
      https://github.com/llvm/llvm-project/commit/c9fb37c75f741f1179f2d2c661d27d36645b0310
  Author: jeanPerier <jperier at nvidia.com>
  Date:   2025-10-22 (Wed, 22 Oct 2025)

  Changed paths:
    M flang/include/flang/Optimizer/Dialect/FIROps.td
    M flang/lib/Lower/Bridge.cpp
    M flang/lib/Lower/ConvertVariable.cpp
    M flang/lib/Optimizer/CodeGen/CodeGen.cpp
    M flang/lib/Optimizer/Dialect/FIROps.cpp
    M flang/lib/Optimizer/Transforms/ArrayValueCopy.cpp
    A flang/test/Fir/assumed-size-ops-codegen.fir
    A flang/test/Fir/assumed-size-ops-folding.fir
    A flang/test/Fir/assumed-size-ops-roundtrip.fir
    M flang/test/HLFIR/assumed-type-actual-args.f90
    M flang/test/Lower/HLFIR/assumed-rank-iface.f90
    M flang/test/Lower/HLFIR/select-rank.f90
    M flang/test/Lower/Intrinsics/lbound.f90
    M flang/test/Lower/Intrinsics/ubound.f90
    M flang/test/Lower/array-expression-assumed-size.f90
    M flang/test/Lower/entry-statement.f90

  Log Message:
  -----------
  [flang][FIR] add fir.assumed_size_extent to abstract assumed-size extent encoding (#164452)

The purpose of this patch is to allow converting FIR array representation to
memref when possible without hitting memref verifier issue.

The issue was that FIR arrays may be assumed size, in which case the
last dimension will not be known at runtime. Flang uses -1 to encode
this to fulfill Fortran 2023 standard requirements in 18.5.3 point 5
about CFI_desc_t.

When arrays are converted to memeref, if this `-1` reaches memeref
operations, it triggers verifier errors (even if the conversion happened
in code that guards the code to be entered at runtime if the array is
assumed-size because folders/verifiers do not take into account
reachability).

This follows-up on discussions in #163505 merge requests



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