[flang-commits] [flang] [llvm] [OpenMP][LLVM] Update alloca IP after `PrivCB` in `OMPIRBUIlder` (PR #93920)
Mats Petersson via flang-commits
flang-commits at lists.llvm.org
Fri May 31 03:03:49 PDT 2024
================
@@ -1583,6 +1583,9 @@ IRBuilder<>::InsertPoint OpenMPIRBuilder::createParallel(
} else {
Builder.restoreIP(
PrivCB(InnerAllocaIP, Builder.saveIP(), V, *Inner, ReplacementValue));
+ InnerAllocaIP = {InnerAllocaIP.getPoint()->getParent(),
----------------
Leporacanthicus wrote:
So, the problem leading to this is that we've split the Alloca block [because the variable is allocatable], and the actual insert point is now the branch of the second block.
I don't think we want the new AllocaIP to be in that second block, in case someone adds more alloca ops - they should go into the first block.
My PR, that Kiran mentioned, has several of this kind of fixes [I will check if it fixes this case too,]. Whenever possible, I try to make the new location at the terminator of the original AllocaIP block.
https://github.com/llvm/llvm-project/pull/93920
More information about the flang-commits
mailing list