[all-commits] [llvm/llvm-project] 2177a1: [flang][runtime] Avoid call recursion in CopyEleme...

Slava Zakharin via All-commits all-commits at lists.llvm.org
Thu Aug 1 09:39:46 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2177a1767b88d684830b83ac7f06d0f9f15102e2
      https://github.com/llvm/llvm-project/commit/2177a1767b88d684830b83ac7f06d0f9f15102e2
  Author: Slava Zakharin <szakharin at nvidia.com>
  Date:   2024-08-01 (Thu, 01 Aug 2024)

  Changed paths:
    M flang/runtime/copy.cpp
    M flang/runtime/copy.h
    A flang/runtime/stack.h

  Log Message:
  -----------
  [flang][runtime] Avoid call recursion in CopyElement runtime. (#101421)

Device compilers may fail to identify maximum stack size required
by a kernel that calls CopyElement due to potential recursive calls.
To avoid this, we can use dynamically allocated Stack. To avoid
dynamic allocations on the host for simple cases, the Stack
implementation
has a reserved space (that ends up being allocated on the program
stack).
I tested both pre-allocated and 0-reserve implementations on the host,
and all passed. The actual reserve values might be tuned as needed.



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