[PATCH] D140415: [flang] stack arrays pass

Johannes Doerfert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 25 08:18:06 PST 2023


jdoerfert added a comment.

Quick questions, and they might not apply here since you seem to only look at explicit Flang generated values, right?
Are you handling unwinding/exceptions, especially in-between the allocation and deallocation?
Are you handling non-accessible stacks (e.g., on GPUs) for escaping pointers?
Do you check the size to (reasonably) ensure we don't overflow the stack?
Are you trying to move the alloca into the entry, if possible?

Did you check LLVM's heap2stack and the corresponding tests?
https://github.com/llvm/llvm-project/blob/c68af565ff0c2fdc5537e9ac0c2d7c75df44b035/llvm/lib/Transforms/IPO/AttributorAttributes.cpp#L6480
https://github.com/llvm/llvm-project/blob/main/llvm/test/Transforms/Attributor/heap_to_stack.ll
https://github.com/llvm/llvm-project/blob/main/llvm/test/Transforms/Attributor/heap_to_stack_gpu.ll


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140415/new/

https://reviews.llvm.org/D140415



More information about the cfe-commits mailing list