[Mlir-commits] [mlir] [flang] [WIP] Delayed privatization. (PR #79862)
Leandro Lupori
llvmlistbot at llvm.org
Thu Feb 1 11:40:42 PST 2024
================
@@ -0,0 +1,43 @@
+subroutine delayed_privatization()
+ integer :: var1
+ integer :: var2
+
+!$OMP PARALLEL FIRSTPRIVATE(var1, var2)
+ var1 = var1 + var2 + 2
+!$OMP END PARALLEL
+
+end subroutine
+
+! This is what flang emits with the PoC:
+! --------------------------------------
+!
+!func.func @_QPdelayed_privatization() {
+! %0 = fir.alloca i32 {bindc_name = "var1", uniq_name = "_QFdelayed_privatizationEvar1"}
+! %1 = fir.alloca i32 {bindc_name = "var2", uniq_name = "_QFdelayed_privatizationEvar2"}
+! omp.parallel private(@var1.privatizer %0, @var2.privatizer %1 : !fir.ref<i32>, !fir.ref<i32>) {
----------------
luporl wrote:
I was expecting this to be
`omp.parallel private(@var1.privatizer %0 : !fir.ref<i32>, @var2.privatizer %1 : !fir.ref<i32>)`,
similar to what is done in `reduction` and `copyprivate`.
Is there any reason to list the types separately, at the end?
https://github.com/llvm/llvm-project/pull/79862
More information about the Mlir-commits
mailing list