[all-commits] [llvm/llvm-project] 1fcb6a: [flang][OpenMP] Initialize allocatable members of ...

Leandro Lupori via All-commits all-commits at lists.llvm.org
Thu Dec 19 12:27:12 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1fcb6a9754a8db057e18f629cb90011b638901e7
      https://github.com/llvm/llvm-project/commit/1fcb6a9754a8db057e18f629cb90011b638901e7
  Author: Leandro Lupori <leandro.lupori at linaro.org>
  Date:   2024-12-19 (Thu, 19 Dec 2024)

  Changed paths:
    M flang/include/flang/Lower/AbstractConverter.h
    M flang/include/flang/Lower/ConvertVariable.h
    M flang/include/flang/Optimizer/Builder/Runtime/Derived.h
    M flang/include/flang/Runtime/derived-api.h
    M flang/lib/Lower/Bridge.cpp
    M flang/lib/Lower/ConvertVariable.cpp
    M flang/lib/Lower/OpenMP/DataSharingProcessor.cpp
    M flang/lib/Lower/OpenMP/DataSharingProcessor.h
    M flang/lib/Optimizer/Builder/Runtime/Derived.cpp
    M flang/runtime/derived-api.cpp
    M flang/runtime/derived.cpp
    M flang/runtime/derived.h
    A flang/test/Lower/OpenMP/derived-type-allocatable.f90

  Log Message:
  -----------
  [flang][OpenMP] Initialize allocatable members of derived types (#120295)

Allocatable members of privatized derived types must be allocated,
with the same bounds as the original object, whenever that member
is also allocated in it, but Flang was not performing such
initialization.

The `Initialize` runtime function can't perform this task unless
its signature is changed to receive an additional parameter, the
original object, that is needed to find out which allocatable
members, with their bounds, must also be allocated in the clone.
As `Initialize` is used not only for privatization, sometimes this
other object won't even exist, so this new parameter would need
to be optional.
Because of this, it seemed better to add a new runtime function:
`InitializeClone`.
To avoid unnecessary calls, lowering inserts a call to it only for
privatized items that are derived types with allocatable members.

Fixes https://github.com/llvm/llvm-project/issues/114888
Fixes https://github.com/llvm/llvm-project/issues/114889



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