[llvm] [OpenMP][OMPIRBuilder] Add support to omp target parallel (PR #67000)

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 3 14:52:10 PDT 2023


================
@@ -1090,6 +1097,174 @@ void OpenMPIRBuilder::emitCancelationCheckImpl(Value *CancelFlag,
   Builder.SetInsertPoint(NonCancellationBlock, NonCancellationBlock->begin());
 }
 
+static void targetParallelCallback(OpenMPIRBuilder *OMPIRBuilder,
+                                   Function &OutlinedFn, Function *OuterFn,
+                                   Value *Ident, Value *IfCondition,
+                                   Value *NumThreads, Instruction *PrivTID,
+                                   AllocaInst *PrivTIDAddr, Value *ThreadID,
+                                   SmallVector<Instruction *, 4> ToBeDeleted) {
----------------
jdoerfert wrote:

Why is the vector passed by copy. Either by value, if needed, or just make a new one here. I believe some of the pointers are also not actually initialized by the caller but just used in here. No need to pass them.

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


More information about the llvm-commits mailing list