From 97e17e15957bf6f03923ca46301b32cad507f34b Mon Sep 17 00:00:00 2001 From: Kareem Ergawy Date: Tue, 17 Jun 2025 11:34:05 +0200 Subject: [PATCH] Revert "[flang] Enable delayed localization by default for `do concurrent` (#144074)" (#144476) This reverts commit b5dbf8210a57b986b9802304745f4c5c108cf37b. Reverting again due to gfortran failure: https://lab.llvm.org/buildbot/#/builders/17/builds/8868 --- flang/lib/Lower/Bridge.cpp | 6 +++++- flang/test/Lower/do_concurrent_delayed_locality.f90 | 2 +- flang/test/Lower/do_concurrent_local_assoc_entity.f90 | 2 +- flang/test/Lower/do_concurrent_local_default_init.f90 | 2 +- flang/test/Lower/loops.f90 | 2 +- flang/test/Lower/loops3.f90 | 2 +- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/flang/lib/Lower/Bridge.cpp b/flang/lib/Lower/Bridge.cpp index 5ff8101dba09..64b16b3abe99 100644 --- a/flang/lib/Lower/Bridge.cpp +++ b/flang/lib/Lower/Bridge.cpp @@ -2033,7 +2033,11 @@ private: fir::LocalitySpecifierOperands privateClauseOps; auto doConcurrentLoopOp = mlir::dyn_cast_if_present(info.loopOp); - bool useDelayedPriv = enableDelayedPrivatization && doConcurrentLoopOp; + // TODO Promote to using `enableDelayedPrivatization` (which is enabled by + // default unlike the staging flag) once the implementation of this is more + // complete. + bool useDelayedPriv = + enableDelayedPrivatizationStaging && doConcurrentLoopOp; llvm::SetVector allPrivatizedSymbols; llvm::SmallSet mightHaveReadHostSym; diff --git a/flang/test/Lower/do_concurrent_delayed_locality.f90 b/flang/test/Lower/do_concurrent_delayed_locality.f90 index 039b17808d19..6cae0eb46db1 100644 --- a/flang/test/Lower/do_concurrent_delayed_locality.f90 +++ b/flang/test/Lower/do_concurrent_delayed_locality.f90 @@ -1,4 +1,4 @@ -! RUN: %flang_fc1 -emit-hlfir -o - %s | FileCheck %s +! RUN: %flang_fc1 -emit-hlfir -mmlir --enable-delayed-privatization-staging=true -o - %s | FileCheck %s subroutine do_concurrent_with_locality_specs implicit none diff --git a/flang/test/Lower/do_concurrent_local_assoc_entity.f90 b/flang/test/Lower/do_concurrent_local_assoc_entity.f90 index 67f080eb2c1c..a3d0c34ed856 100644 --- a/flang/test/Lower/do_concurrent_local_assoc_entity.f90 +++ b/flang/test/Lower/do_concurrent_local_assoc_entity.f90 @@ -1,4 +1,4 @@ -! RUN: %flang_fc1 -emit-hlfir -o - %s | FileCheck %s +! RUN: %flang_fc1 -emit-hlfir -mmlir --enable-delayed-privatization-staging=true -o - %s | FileCheck %s subroutine local_assoc implicit none diff --git a/flang/test/Lower/do_concurrent_local_default_init.f90 b/flang/test/Lower/do_concurrent_local_default_init.f90 index 798cbb335c8c..d64321385474 100644 --- a/flang/test/Lower/do_concurrent_local_default_init.f90 +++ b/flang/test/Lower/do_concurrent_local_default_init.f90 @@ -1,5 +1,5 @@ ! Test default initialization of DO CONCURRENT LOCAL() entities. -! RUN: bbc -emit-hlfir -I nowhere -o - %s | FileCheck %s +! RUN: bbc -emit-hlfir --enable-delayed-privatization-staging=true -I nowhere -o - %s | FileCheck %s subroutine test_ptr(p) interface diff --git a/flang/test/Lower/loops.f90 b/flang/test/Lower/loops.f90 index 64f14ff97227..60df27a591dc 100644 --- a/flang/test/Lower/loops.f90 +++ b/flang/test/Lower/loops.f90 @@ -1,4 +1,4 @@ -! RUN: bbc -emit-fir -hlfir=false --enable-delayed-privatization=false -o - %s | FileCheck %s +! RUN: bbc -emit-fir -hlfir=false -o - %s | FileCheck %s ! CHECK-LABEL: loop_test subroutine loop_test diff --git a/flang/test/Lower/loops3.f90 b/flang/test/Lower/loops3.f90 index 34d7bcfb7d7a..84db1972cca1 100644 --- a/flang/test/Lower/loops3.f90 +++ b/flang/test/Lower/loops3.f90 @@ -1,5 +1,5 @@ ! Test do concurrent reduction -! RUN: bbc -emit-fir -hlfir=false --enable-delayed-privatization=false -o - %s | FileCheck %s +! RUN: bbc -emit-fir -hlfir=false -o - %s | FileCheck %s ! CHECK-LABEL: loop_test subroutine loop_test