[flang-commits] [mlir] [flang] [WIP] Delayed privatization. (PR #79862)

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Fri Feb 2 01:55:35 PST 2024


================
@@ -0,0 +1,38 @@
+// RUN: fir-opt -verify-diagnostics %s | fir-opt | FileCheck %s
+
+// CHECK-LABEL: _QPprivate_clause
+func.func @_QPprivate_clause() {
+  %0 = fir.alloca i32 {bindc_name = "x", uniq_name = "_QFprivate_clause_allocatableEx"}
+  %1 = fir.alloca i32 {bindc_name = "y", uniq_name = "_QFprivate_clause_allocatableEy"}
+
+  // CHECK: omp.parallel private(@x.privatizer %0 -> %arg0, @y.privatizer %1 -> %arg1 : !fir.ref<i32>, !fir.ref<i32>)
+  omp.parallel private(@x.privatizer %0 -> %arg0, @y.privatizer %1 -> %arg1 : !fir.ref<i32>, !fir.ref<i32>) {
----------------
kiranchandramohan wrote:

Sorry, I missed this point.
I think we need a block argument or a new value to keep the dataflow correct in the MLIR layer. In the current representation, loads and stores to `%0` and `%1` are to the original variable and not the privatized variable.

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


More information about the flang-commits mailing list