[flang-commits] [flang] [llvm] [mlir] [flang][OpenMP] Handle `omp.private` in `FirOpBuilder::getAllocaBlock()` (PR #93927)

Kareem Ergawy via flang-commits flang-commits at lists.llvm.org
Sun Jun 2 05:19:28 PDT 2024


================
@@ -252,7 +252,8 @@ mlir::Block *fir::FirOpBuilder::getAllocaBlock() {
               .getParentOfType<mlir::omp::OutlineableOpenMPOpInterface>()) {
     return ompOutlineableIface.getAllocaBlock();
   }
-  if (getRegion().getParentOfType<mlir::omp::DeclareReductionOp>())
+  if (getRegion().getParentOfType<mlir::omp::DeclareReductionOp>() ||
+      getRegion().getParentOfType<mlir::omp::PrivateClauseOp>())
----------------
ergawy wrote:

Makes sense. I updated the PR to reuse the `RecipeInterface` for both OpenMP and OpenACC.

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


More information about the flang-commits mailing list