[flang-commits] [flang] [flang][MLIR][OpenMP] Extend delayed privatization for scalar allocatables (PR #84740)

Kareem Ergawy via flang-commits flang-commits at lists.llvm.org
Tue Mar 12 00:53:59 PDT 2024


================
@@ -0,0 +1,33 @@
+! Test delayed privatization for allocatables: `firstprivate`.
+
+! RUN: bbc -emit-hlfir -fopenmp --openmp-enable-delayed-privatization -o - %s 2>&1 | FileCheck %s
+
+subroutine delayed_privatization_allocatable
+  implicit none
+  integer, allocatable :: var1
+
+!$omp parallel firstprivate(var1)
+  var1 = 10
+!$omp end parallel
+end subroutine
+
+! CHECK-LABEL: omp.private {type = firstprivate}
+! CHECK-SAME: @[[PRIVATIZER_SYM:.*]] : [[TYPE:!fir.ref<!fir.box<!fir.heap<i32>>>]] alloc {
+
+! CHECK-NEXT: ^bb0(%[[PRIV_ARG:.*]]: [[TYPE]]):
+
----------------
ergawy wrote:

Indeed, instead of just copying the check lines from the private test again, I skipped most of it here. Let me know if you prefer to repeat the checks here as well.

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


More information about the flang-commits mailing list