Skip to content

Commit 7e9887a

Browse files
authored
[flang] Generlize names of delayed privatization CLI flags (#138816)
Remove the `openmp` prefix from delayed privatization/localization flags since they are now used for `do concurrent` as well. PR stack: - #137928 - #138505 - #138506 - #138512 - #138534 - #138816 (this PR)
1 parent 9ea4924 commit 7e9887a

35 files changed

+96
-71
lines changed

flang/include/flang/Support/Flags.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//===-- include/flang/Support/Flags.h ---------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef FORTRAN_SUPPORT_FLAGS_H_
10+
#define FORTRAN_SUPPORT_FLAGS_H_
11+
12+
#include "llvm/Support/CommandLine.h"
13+
14+
extern llvm::cl::opt<bool> enableDelayedPrivatization;
15+
extern llvm::cl::opt<bool> enableDelayedPrivatizationStaging;
16+
17+
#endif // FORTRAN_SUPPORT_FLAGS_H_

flang/lib/Lower/Bridge.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include "flang/Lower/Bridge.h"
1414

1515
#include "OpenMP/DataSharingProcessor.h"
16-
#include "OpenMP/Utils.h"
1716
#include "flang/Lower/Allocatable.h"
1817
#include "flang/Lower/CallInterface.h"
1918
#include "flang/Lower/Coarray.h"
@@ -63,6 +62,7 @@
6362
#include "flang/Semantics/runtime-type-info.h"
6463
#include "flang/Semantics/symbol.h"
6564
#include "flang/Semantics/tools.h"
65+
#include "flang/Support/Flags.h"
6666
#include "flang/Support/Version.h"
6767
#include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h"
6868
#include "mlir/IR/BuiltinAttributes.h"

flang/lib/Lower/OpenMP/OpenMP.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "flang/Parser/parse-tree.h"
3535
#include "flang/Semantics/openmp-directive-sets.h"
3636
#include "flang/Semantics/tools.h"
37+
#include "flang/Support/Flags.h"
3738
#include "flang/Support/OpenMP-utils.h"
3839
#include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h"
3940
#include "mlir/Dialect/OpenMP/OpenMPDialect.h"

flang/lib/Lower/OpenMP/Utils.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,6 @@ llvm::cl::opt<bool> treatIndexAsSection(
3333
llvm::cl::desc("In the OpenMP data clauses treat `a(N)` as `a(N:N)`."),
3434
llvm::cl::init(true));
3535

36-
llvm::cl::opt<bool> enableDelayedPrivatization(
37-
"openmp-enable-delayed-privatization",
38-
llvm::cl::desc(
39-
"Emit `[first]private` variables as clauses on the MLIR ops."),
40-
llvm::cl::init(true));
41-
42-
llvm::cl::opt<bool> enableDelayedPrivatizationStaging(
43-
"openmp-enable-delayed-privatization-staging",
44-
llvm::cl::desc("For partially supported constructs, emit `[first]private` "
45-
"variables as clauses on the MLIR ops."),
46-
llvm::cl::init(false));
47-
4836
namespace Fortran {
4937
namespace lower {
5038
namespace omp {

flang/lib/Lower/OpenMP/Utils.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
#include <cstdint>
1818

1919
extern llvm::cl::opt<bool> treatIndexAsSection;
20-
extern llvm::cl::opt<bool> enableDelayedPrivatization;
21-
extern llvm::cl::opt<bool> enableDelayedPrivatizationStaging;
2220

2321
namespace fir {
2422
class FirOpBuilder;

flang/lib/Support/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ endif()
4444

4545
add_flang_library(FortranSupport
4646
default-kinds.cpp
47+
Flags.cpp
4748
Fortran.cpp
4849
Fortran-features.cpp
4950
idioms.cpp

flang/lib/Support/Flags.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//===-- lib/Support/Flags.cpp ---------------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#include "flang/Support/Flags.h"
10+
11+
llvm::cl::opt<bool> enableDelayedPrivatization("enable-delayed-privatization",
12+
llvm::cl::desc(
13+
"Emit private/local variables as clauses/specifiers on MLIR ops."),
14+
llvm::cl::init(true));
15+
16+
llvm::cl::opt<bool> enableDelayedPrivatizationStaging(
17+
"enable-delayed-privatization-staging",
18+
llvm::cl::desc("For partially supported constructs, emit private/local "
19+
"variables as clauses/specifiers on MLIR ops."),
20+
llvm::cl::init(false));

flang/test/Lower/OpenMP/DelayedPrivatization/distribute-standalone-private.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
! RUN: %flang_fc1 -emit-hlfir -fopenmp -mmlir --openmp-enable-delayed-privatization-staging \
1+
! RUN: %flang_fc1 -emit-hlfir -fopenmp -mmlir --enable-delayed-privatization-staging \
22
! RUN: -o - %s 2>&1 | FileCheck %s
3-
! RUN: bbc -emit-hlfir -fopenmp --openmp-enable-delayed-privatization-staging -o - %s 2>&1 \
3+
! RUN: bbc -emit-hlfir -fopenmp --enable-delayed-privatization-staging -o - %s 2>&1 \
44
! RUN: | FileCheck %s
55

66
subroutine standalone_distribute

flang/test/Lower/OpenMP/DelayedPrivatization/equivalence.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
! Test delayed privatization for variables that are storage associated via `EQUIVALENCE`.
22

3-
! RUN: %flang_fc1 -emit-hlfir -fopenmp -mmlir --openmp-enable-delayed-privatization \
3+
! RUN: %flang_fc1 -emit-hlfir -fopenmp -mmlir --enable-delayed-privatization \
44
! RUN: -o - %s 2>&1 | FileCheck %s
5-
! RUN: bbc -emit-hlfir -fopenmp --openmp-enable-delayed-privatization -o - %s 2>&1 \
5+
! RUN: bbc -emit-hlfir -fopenmp --enable-delayed-privatization -o - %s 2>&1 \
66
! RUN: | FileCheck %s
77

88
subroutine private_common

flang/test/Lower/OpenMP/DelayedPrivatization/target-private-allocatable.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
! Tests delayed privatization for `targets ... private(..)` for allocatables.
22

3-
! RUN: %flang_fc1 -emit-hlfir -fopenmp -mmlir --openmp-enable-delayed-privatization-staging \
3+
! RUN: %flang_fc1 -emit-hlfir -fopenmp -mmlir --enable-delayed-privatization-staging \
44
! RUN: -o - %s 2>&1 | FileCheck %s
5-
! RUN: bbc -emit-hlfir -fopenmp --openmp-enable-delayed-privatization-staging -o - %s 2>&1 \
5+
! RUN: bbc -emit-hlfir -fopenmp --enable-delayed-privatization-staging -o - %s 2>&1 \
66
! RUN: | FileCheck %s
77

88
subroutine target_allocatable

0 commit comments

Comments
 (0)