-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[flang] Enable delayed localization by default for do concurrent
#144074
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-flang-fir-hlfir Author: Kareem Ergawy (ergawy) ChangesReintroduces 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. Full diff: https://github.com/llvm/llvm-project/pull/144074.diff 6 Files Affected:
diff --git a/flang/lib/Lower/Bridge.cpp b/flang/lib/Lower/Bridge.cpp
index 64b16b3abe991..5ff8101dba097 100644
--- a/flang/lib/Lower/Bridge.cpp
+++ b/flang/lib/Lower/Bridge.cpp
@@ -2033,11 +2033,7 @@ class FirConverter : public Fortran::lower::AbstractConverter {
fir::LocalitySpecifierOperands privateClauseOps;
auto doConcurrentLoopOp =
mlir::dyn_cast_if_present<fir::DoConcurrentLoopOp>(info.loopOp);
- // 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;
+ bool useDelayedPriv = enableDelayedPrivatization && doConcurrentLoopOp;
llvm::SetVector<const Fortran::semantics::Symbol *> allPrivatizedSymbols;
llvm::SmallSet<const Fortran::semantics::Symbol *, 16> mightHaveReadHostSym;
diff --git a/flang/test/Lower/do_concurrent_delayed_locality.f90 b/flang/test/Lower/do_concurrent_delayed_locality.f90
index 6cae0eb46db13..039b17808d19e 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 -mmlir --enable-delayed-privatization-staging=true -o - %s | FileCheck %s
+! RUN: %flang_fc1 -emit-hlfir -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 a3d0c34ed8569..67f080eb2c1c5 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 -mmlir --enable-delayed-privatization-staging=true -o - %s | FileCheck %s
+! RUN: %flang_fc1 -emit-hlfir -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 d643213854744..798cbb335c8c0 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 --enable-delayed-privatization-staging=true -I nowhere -o - %s | FileCheck %s
+! RUN: bbc -emit-hlfir -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 60df27a591dc3..64f14ff972272 100644
--- a/flang/test/Lower/loops.f90
+++ b/flang/test/Lower/loops.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-fir -hlfir=false -o - %s | FileCheck %s
+! RUN: bbc -emit-fir -hlfir=false --enable-delayed-privatization=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 84db1972cca16..34d7bcfb7d7ad 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 -o - %s | FileCheck %s
+! RUN: bbc -emit-fir -hlfir=false --enable-delayed-privatization=false -o - %s | FileCheck %s
! CHECK-LABEL: loop_test
subroutine loop_test
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, miniWeather worked for me with this patch.
Looks like there is still a gfortran failure in the test suite: https://lab.llvm.org/buildbot/#/builders/17/builds/8868
|
…rent` (#144074)" This reverts commit b5dbf82. Reverting again due to gfortran failure: https://lab.llvm.org/buildbot/#/builders/17/builds/8868
Oh boy! Sorry for that. Reverted again and looking into the issue: #144476. |
Thanks, the issue is that builder.getAllocaBlock does not work inside a fir.local. I have not looked futher. Repro with
|
…rent` (#144074)" (#144476) This reverts commit b5dbf82. Reverting again due to gfortran failure: https://lab.llvm.org/buildbot/#/builders/17/builds/8868
…lvm#144074) Reintroduces changes from llvm#143897. A fix for the reported problem in llvm#143897 is hopefully resolved in llvm#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.
…rent` (llvm#144074)" (llvm#144476) This reverts commit b5dbf82. Reverting again due to gfortran failure: https://lab.llvm.org/buildbot/#/builders/17/builds/8868
…lvm#144074) Reintroduces changes from llvm#143897. A fix for the reported problem in llvm#143897 is hopefully resolved in llvm#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.
…rent` (llvm#144074)" (llvm#144476) This reverts commit b5dbf82. Reverting again due to gfortran failure: https://lab.llvm.org/buildbot/#/builders/17/builds/8868
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.