[llvm-branch-commits] [flang] [flang][OpenMP] Enable delayed privatization by default for `omp.distribute` (PR #131574)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Mar 17 00:13:34 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-flang-openmp
Author: Kareem Ergawy (ergawy)
<details>
<summary>Changes</summary>
Switches delayed privatization for `omp.distribute` to be on by default: controlled by the `-openmp-enable-delayed-privatization` instead of by `-openmp-enable-delayed-privatization-staging`
---
Full diff: https://github.com/llvm/llvm-project/pull/131574.diff
4 Files Affected:
- (modified) flang/lib/Lower/OpenMP/OpenMP.cpp (+1-1)
- (modified) flang/test/Lower/OpenMP/distribute.f90 (+1-1)
- (modified) flang/test/Lower/OpenMP/order-clause.f90 (+3-3)
- (modified) flang/test/Transforms/stack-arrays-hlfir.f90 (+1-1)
``````````diff
diff --git a/flang/lib/Lower/OpenMP/OpenMP.cpp b/flang/lib/Lower/OpenMP/OpenMP.cpp
index 2cfc1bd88dcef..f753ce1e82288 100644
--- a/flang/lib/Lower/OpenMP/OpenMP.cpp
+++ b/flang/lib/Lower/OpenMP/OpenMP.cpp
@@ -2549,7 +2549,7 @@ static void genStandaloneDistribute(lower::AbstractConverter &converter,
DataSharingProcessor dsp(converter, semaCtx, item->clauses, eval,
/*shouldCollectPreDeterminedSymbols=*/true,
- enableDelayedPrivatizationStaging, symTable);
+ enableDelayedPrivatization, symTable);
dsp.processStep1(&distributeClauseOps);
mlir::omp::LoopNestOperands loopNestClauseOps;
diff --git a/flang/test/Lower/OpenMP/distribute.f90 b/flang/test/Lower/OpenMP/distribute.f90
index a4a753dddbac4..ea57d35b964b4 100644
--- a/flang/test/Lower/OpenMP/distribute.f90
+++ b/flang/test/Lower/OpenMP/distribute.f90
@@ -7,7 +7,7 @@ subroutine distribute_simple()
! CHECK: omp.teams
!$omp teams
- ! CHECK: omp.distribute {
+ ! CHECK: omp.distribute private({{.*}}) {
!$omp distribute
! CHECK-NEXT: omp.loop_nest
diff --git a/flang/test/Lower/OpenMP/order-clause.f90 b/flang/test/Lower/OpenMP/order-clause.f90
index 1f678e02708da..d5799079b3759 100644
--- a/flang/test/Lower/OpenMP/order-clause.f90
+++ b/flang/test/Lower/OpenMP/order-clause.f90
@@ -61,15 +61,15 @@ end subroutine do_simd_order_parallel
subroutine distribute_order
- !CHECK: omp.distribute order(reproducible:concurrent) {
+ !CHECK: omp.distribute order(reproducible:concurrent) private({{.*}}) {
!$omp teams distribute order(concurrent)
do i=1,10
end do
- !CHECK: omp.distribute order(reproducible:concurrent) {
+ !CHECK: omp.distribute order(reproducible:concurrent) private({{.*}}) {
!$omp teams distribute order(reproducible:concurrent)
do i=1,10
end do
- !CHECK: omp.distribute order(unconstrained:concurrent) {
+ !CHECK: omp.distribute order(unconstrained:concurrent) private({{.*}}) {
!$omp teams distribute order(unconstrained:concurrent)
do i = 1, 10
end do
diff --git a/flang/test/Transforms/stack-arrays-hlfir.f90 b/flang/test/Transforms/stack-arrays-hlfir.f90
index 06749b7ca88af..e70a1d9b89216 100644
--- a/flang/test/Transforms/stack-arrays-hlfir.f90
+++ b/flang/test/Transforms/stack-arrays-hlfir.f90
@@ -73,7 +73,7 @@ end subroutine omp_target_wsloop
! CHECK-NOT: fir.freemem
! CHECK: omp.teams {
! CHECK: fir.alloca !fir.array<2xi64>
-! CHECK: omp.distribute {
+! CHECK: omp.distribute private({{.*}}) {
! CHECK: omp.loop_nest {{.*}} {
! CHECK-NOT: fir.allocmem
! CHECK-NOT: fir.freemem
``````````
</details>
https://github.com/llvm/llvm-project/pull/131574
More information about the llvm-branch-commits
mailing list