[Mlir-commits] [mlir] [MLIR][OpenMP] Extend omp.private materialization support: `firstprivate` (PR #82164)

Kareem Ergawy llvmlistbot at llvm.org
Tue Feb 27 20:13:25 PST 2024


================
@@ -1169,17 +1169,38 @@ convertOmpParallel(omp::ParallelOp opInst, llvm::IRBuilderBase &builder,
     }();
 
     if (privVar) {
+      Region &allocRegion = privatizerClone.getAllocRegion();
+
+      // If this is a `firstprivate` clause, prepare the `omp.private` op by:
       if (privatizerClone.getDataSharingType() ==
           omp::DataSharingClauseType::FirstPrivate) {
-        privatizerClone.emitOpError(
-            "TODO: delayed privatization is not "
-            "supported for `firstprivate` clauses yet.");
-        bodyGenStatus = failure();
-        return codeGenIP;
+        auto oldAllocBackBlock = std::prev(allocRegion.end());
+        omp::YieldOp oldAllockYieldOp =
----------------
ergawy wrote:

Indeed. That's a weird typo :D.

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


More information about the Mlir-commits mailing list