[all-commits] [llvm/llvm-project] 94c024: [flang][lowering] delay stack save/restor emission...

jeanPerier via All-commits all-commits at lists.llvm.org
Thu Sep 19 04:53:19 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 94c024adedcb53059c29d7c2d62982053b60e86a
      https://github.com/llvm/llvm-project/commit/94c024adedcb53059c29d7c2d62982053b60e86a
  Author: jeanPerier <jperier at nvidia.com>
  Date:   2024-09-19 (Thu, 19 Sep 2024)

  Changed paths:
    M flang/lib/Lower/ConvertCall.cpp
    M flang/test/Lower/HLFIR/elemental-array-ops.f90
    A flang/test/Lower/HLFIR/elemental-user-procedure-stacksave.f90

  Log Message:
  -----------
  [flang][lowering] delay stack save/restor emission in elemental calls (#109142)

stack save/restore emitted for character elemental function result
allocation inside hlfir.elemental in lowering created memory bugs
because result memory is actually still used after the stack restore
when lowering the elemental into a loop where the result element is
copied into the array result storage.

Instead of adding special handling for stack save/restore in lowering,
just avoid emitting those since the stack reclaim pass is able to emit
them in the generated loop. Not having those stack save/restore will
also help optimizations that want to elide the temporary allocation for
the element result when that is possible.



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