Skip to content

Commit b5dbf82

Browse files
authored
[flang] Enable delayed localization by default for do concurrent (#144074)
Reintroduces changes from #143897. A fix for the reported problem in #143897 is hopefully resolved in #144027. This PR aims to make it easier and more self-contained to revert the switch/flag if we discover any problems with enabling it by default.
1 parent 7caeec5 commit b5dbf82

File tree

6 files changed

+6
-10
lines changed

6 files changed

+6
-10
lines changed

flang/lib/Lower/Bridge.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,11 +2033,7 @@ class FirConverter : public Fortran::lower::AbstractConverter {
20332033
fir::LocalitySpecifierOperands privateClauseOps;
20342034
auto doConcurrentLoopOp =
20352035
mlir::dyn_cast_if_present<fir::DoConcurrentLoopOp>(info.loopOp);
2036-
// TODO Promote to using `enableDelayedPrivatization` (which is enabled by
2037-
// default unlike the staging flag) once the implementation of this is more
2038-
// complete.
2039-
bool useDelayedPriv =
2040-
enableDelayedPrivatizationStaging && doConcurrentLoopOp;
2036+
bool useDelayedPriv = enableDelayedPrivatization && doConcurrentLoopOp;
20412037
llvm::SetVector<const Fortran::semantics::Symbol *> allPrivatizedSymbols;
20422038
llvm::SmallSet<const Fortran::semantics::Symbol *, 16> mightHaveReadHostSym;
20432039

flang/test/Lower/do_concurrent_delayed_locality.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
! RUN: %flang_fc1 -emit-hlfir -mmlir --enable-delayed-privatization-staging=true -o - %s | FileCheck %s
1+
! RUN: %flang_fc1 -emit-hlfir -o - %s | FileCheck %s
22

33
subroutine do_concurrent_with_locality_specs
44
implicit none

flang/test/Lower/do_concurrent_local_assoc_entity.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
! RUN: %flang_fc1 -emit-hlfir -mmlir --enable-delayed-privatization-staging=true -o - %s | FileCheck %s
1+
! RUN: %flang_fc1 -emit-hlfir -o - %s | FileCheck %s
22

33
subroutine local_assoc
44
implicit none

flang/test/Lower/do_concurrent_local_default_init.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
! Test default initialization of DO CONCURRENT LOCAL() entities.
2-
! RUN: bbc -emit-hlfir --enable-delayed-privatization-staging=true -I nowhere -o - %s | FileCheck %s
2+
! RUN: bbc -emit-hlfir -I nowhere -o - %s | FileCheck %s
33

44
subroutine test_ptr(p)
55
interface

flang/test/Lower/loops.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
! RUN: bbc -emit-fir -hlfir=false -o - %s | FileCheck %s
1+
! RUN: bbc -emit-fir -hlfir=false --enable-delayed-privatization=false -o - %s | FileCheck %s
22

33
! CHECK-LABEL: loop_test
44
subroutine loop_test

flang/test/Lower/loops3.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
! Test do concurrent reduction
2-
! RUN: bbc -emit-fir -hlfir=false -o - %s | FileCheck %s
2+
! RUN: bbc -emit-fir -hlfir=false --enable-delayed-privatization=false -o - %s | FileCheck %s
33

44
! CHECK-LABEL: loop_test
55
subroutine loop_test

0 commit comments

Comments
 (0)