[flang] Enable delayed localization by default for do concurrent (#142567)

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.
This commit is contained in:
Kareem Ergawy
2025-06-11 10:10:22 +02:00
committed by GitHub
parent 24d730b380
commit 937be17752
6 changed files with 6 additions and 10 deletions

View File

@@ -2033,11 +2033,7 @@ private:
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;

View File

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

View File

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

View File

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

View File

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

View File

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