[all-commits] [llvm/llvm-project] 4b8192: [flang][NFC] centralize FreeMemOp generation in In...

jeanPerier via All-commits all-commits at lists.llvm.org
Mon Jan 16 00:22:39 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4b8192b24c943ae1d17d4979e7f9d2b06cb0182a
      https://github.com/llvm/llvm-project/commit/4b8192b24c943ae1d17d4979e7f9d2b06cb0182a
  Author: Jean Perier <jperier at nvidia.com>
  Date:   2023-01-16 (Mon, 16 Jan 2023)

  Changed paths:
    M flang/lib/Lower/IntrinsicCall.cpp

  Log Message:
  -----------
  [flang][NFC] centralize FreeMemOp generation in IntrinsicCall.cpp

The current intrinsic call lowering contains a lot of repetitive
patterns when it comes to dealing with temporary allocatable
results allocated by the runtime that need to be dereferenced and
for which a clean-up (free) must be scheduled in the StatementContext.

For HLFIR lowering, I will need to deal with the clean-up in a different
way since the results will be "moved" into expression nodes and
the clean-up will be inserted in bufferization after the last hlfir.expr
usage. Centralizing the clean-up code will make that easier, and is
regardless of this motivation a quality improvement.

Some static helpers had to be moved to IntrinsicBuilder method so that
they could call the readAndAddCleanUp code.

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




More information about the All-commits mailing list