[flang-commits] [flang] [mlir] [mlir][OpenMP][flang] make private variable allocation implicit in omp.private (PR #124019)

Leandro Lupori via flang-commits flang-commits at lists.llvm.org
Fri Jan 24 12:33:08 PST 2025


================
@@ -125,22 +123,23 @@ llvm.func @parallel_op_private_multi_block(%arg0: !llvm.ptr) {
 // Check that the privatizer's continuation block yileds the private clone's
 // address.
 // CHECK: [[PRIV_CONT]]:
-// CHECK-NEXT:   %[[PRIV_ALLOC3:.*]] = phi ptr [ %[[PRIV_ALLOC2]], %[[PRIV_BB2]] ]
+// CHECK-NEXT:   %[[ORIG_PTR3:.*]] = phi ptr [ %[[ORIG_PTR2]], %[[PRIV_BB2]] ]
 // CHECK-NEXT:   br label %[[PAR_REG:.*]]
 
-// Check that the body of the parallel region loads from the private clone.
 // CHECK: [[PAR_REG]]:
-// CHECK:        %{{.*}} = load float, ptr %[[PRIV_ALLOC3]], align 4
+// CHECK-NEXT:   br label %[[PAR_REG2:.*]]
 
-omp.private {type = private} @multi_block.privatizer : !llvm.ptr alloc {
-^bb0(%arg0: !llvm.ptr):
-  %c1 = llvm.mlir.constant(1 : i32) : i32
-  %0 = llvm.alloca %c1 x f32 : (i32) -> !llvm.ptr
-  llvm.br ^bb1(%arg0, %0 : !llvm.ptr, !llvm.ptr)
+// Check that the body of the parallel region loads from the private clone.
+// CHECK: [[PAR_REG2]]:
+// CHECK:        %{{.*}} = load float, ptr %[[ORIG_PTR3]], align 4
----------------
luporl wrote:

ORIG_PTR3 doesn't seem to be the private clone, as stated in the comment.

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


More information about the flang-commits mailing list