[all-commits] [llvm/llvm-project] 7f0074: [flang] Avoid double finalization when intrinsic a...

Valentin Clement (バレンタイン クレメン) via All-commits all-commits at lists.llvm.org
Fri Feb 3 03:22:44 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7f0074a64a30c448fec2f36d08dffbe64134e84d
      https://github.com/llvm/llvm-project/commit/7f0074a64a30c448fec2f36d08dffbe64134e84d
  Author: Valentin Clement <clementval at gmail.com>
  Date:   2023-02-03 (Fri, 03 Feb 2023)

  Changed paths:
    M flang/include/flang/Optimizer/Builder/FIRBuilder.h
    M flang/lib/Lower/Bridge.cpp
    M flang/lib/Optimizer/Builder/FIRBuilder.cpp
    M flang/test/Lower/derived-type-finalization.f90

  Log Message:
  -----------
  [flang] Avoid double finalization when intrinsic assignment is done in the runtime

genRecordAssignment is emitting code to call Assign in the runtime for some cases.
In these cases, the finalization is done by the runtime so we do not need to do it in
a separate cal to avoid multiple finalization..
Also refactor the code in Bridge so the actual finalization of allocatable
is done before any reallocation. We might need to push this into ReallocIfNeeded.
It is not clear if the allocatable lhs needs to be finalized in any cases or only if it is
reallocated.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D143186




More information about the All-commits mailing list