[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
Mon Jun 3 06:52:31 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:

I'm hitting further problems (in the real code that we're trying to make work), so I'm OK with this going in if it is helping you get the job done. I personally would prefer it going into the oriiginal allocaIP BB - I'm well aware that not ALL things go in the original BB, but we don't need to make it worse... :)

Also, if all places that need this fix use code like ` builder.SetInsertPoint(allocaIP.getBlock()->getTerminator());` or perhaps: 
```
    allocaIP =
        InsertPointTy(allocaIP.getBlock(),
                      allocaIP.getBlock()->getTerminator()->getIterator());
```
then it makes it a little easier to find ALL such places, and not have to find half a dozen different variants that do slightly different things. 

https://github.com/llvm/llvm-project/pull/93920


More information about the flang-commits mailing list