[flang-commits] [flang] [mlir] [flang][OpenMP] Allow saving first block of an OMP region for allocas (PR #121886)
Kareem Ergawy via flang-commits
flang-commits at lists.llvm.org
Tue Jan 7 03:28:59 PST 2025
ergawy wrote:
Thanks for the quick review.
> Do you mean that the allocation _region_ of the reduction needs to reference `%5`? Shouldn't that be the `init` region (which definately shouldn't be in the alloca block)?
Yes, the `init` region indeed. Your comment made me understand a bigger part of the picture regarding reductions. The problem is that in `initReductionVars`, we start the reduction init logic after the latest alloca block chosen for allocating the reductions: `builder.SetInsertPoint(latestAllocaBlock->getTerminator());`. The latest alloca block (without the changes in this PR) would be before the first block in parent parallel region (in the example mentioned in the description) which causes the bug.
I think we can find a more suitable solution for the issue than the proposed one in this PR, if so I will abandon this PR. Looking into it .... 👀
https://github.com/llvm/llvm-project/pull/121886
More information about the flang-commits
mailing list