[flang-commits] [flang] [mlir] [mlir][OpenMP][flang] make private variable allocation implicit in omp.private (PR #124019)
Tom Eccles via flang-commits
flang-commits at lists.llvm.org
Mon Jan 27 03:07:45 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
----------------
tblah wrote:
Good spot. I made a mistake when I rewrote the privatizer leading it to yield the wrong value.
https://github.com/llvm/llvm-project/pull/124019
More information about the flang-commits
mailing list