[all-commits] [llvm/llvm-project] 87b268: [flang][hlfir] use fir.type_info to skip runtime c...

jeanPerier via All-commits all-commits at lists.llvm.org
Mon Oct 9 00:27:21 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 87b2682ad22bdaa2d8a95cb94a24603cf39a4c1f
      https://github.com/llvm/llvm-project/commit/87b2682ad22bdaa2d8a95cb94a24603cf39a4c1f
  Author: jeanPerier <jperier at nvidia.com>
  Date:   2023-10-09 (Mon, 09 Oct 2023)

  Changed paths:
    M flang/lib/Optimizer/Builder/FIRBuilder.cpp
    A flang/test/HLFIR/assign-codegen-derived.fir
    M flang/test/HLFIR/assign-codegen.fir
    M flang/test/Lower/derived-type-finalization.f90

  Log Message:
  -----------
  [flang][hlfir] use fir.type_info to skip runtime call if nofinal is set (#68397)

HLFIR was always calling Destroy runtime when doing derived type scalar
assignments because the IR did not contain the info of whether
finalization was needed or not.

This info is now available in fir.type_info which allow skipping the
runtime call when not needed.

Also, when finalization is needed, simply use Assign runtime. This makes
no difference from a semantic point of view with the current code that
generated a call to Destroy and did the assignment inline, but if some
piece of runtime must be called anyway, it is simpler to just call
Assign that deals with everything.




More information about the All-commits mailing list