[flang-commits] [flang] 83658dd - [flang][OpenMP] Enable delayed privatization by default for `omp.distribute` (#131574)

via flang-commits flang-commits at lists.llvm.org
Tue Mar 18 06:07:44 PDT 2025


Author: Kareem Ergawy
Date: 2025-03-18T14:07:41+01:00
New Revision: 83658ddb1b58fa10cf5f8ac8dfbe794b7a3701bc

URL: https://github.com/llvm/llvm-project/commit/83658ddb1b58fa10cf5f8ac8dfbe794b7a3701bc
DIFF: https://github.com/llvm/llvm-project/commit/83658ddb1b58fa10cf5f8ac8dfbe794b7a3701bc.diff

LOG: [flang][OpenMP] Enable delayed privatization by default for `omp.distribute` (#131574)

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`.

### GFortran & Fujitsu test suite results:

#### gfotran test-suite (this PR):
```
Testing Time: 34.51s
  Passed: 6569
```

#### Fujitsu without changes (commit: 0813c5cf5f52):
```
Testing Time: 155.39s
  Passed            : 88325
  Failed            :   156
  Executable Missing:   408
```

#### Fujitsu with changes (this PR):
```
Testing Time: 158.54s
  Passed            : 88325
  Failed            :   156
  Executable Missing:   408
```

Added: 
    

Modified: 
    flang/lib/Lower/OpenMP/OpenMP.cpp
    flang/test/Lower/OpenMP/distribute.f90
    flang/test/Lower/OpenMP/order-clause.f90
    flang/test/Transforms/stack-arrays-hlfir.f90

Removed: 
    


################################################################################
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


        


More information about the flang-commits mailing list