[flang-commits] [flang] [llvm] [mlir] [llvm][mlir][OMPIRBuilder] Translate omp.single's copyprivate (PR #80488)

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Tue Feb 27 14:53:16 PST 2024


================
@@ -4025,17 +4028,33 @@ OpenMPIRBuilder::InsertPointTy OpenMPIRBuilder::createSingle(
   Function *ExitRTLFn = getOrCreateRuntimeFunctionPtr(OMPRTL___kmpc_end_single);
   Instruction *ExitCall = Builder.CreateCall(ExitRTLFn, Args);
 
+  auto FiniCBWrapper = [&](InsertPointTy IP) {
+    FiniCB(IP);
+
+    if (DidIt)
+      Builder.CreateStore(Builder.getInt32(1), DidIt);
----------------
kiranchandramohan wrote:

Nit: A comment here also as to why this is being set to one here. Because only the single thread executes the inlined single region.

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


More information about the flang-commits mailing list