Skip to content

Commit 71a0d75

Browse files
authored
[flang][driver] Increase default -fopenmp-version to 52 (#170)
* [flang][driver] Increase default -fopenmp-version to 52 - Currently set to 11 * Fix lit tests & update version in Frontend/CompilerInvocation.cpp * Fix one more test flang/test/Driver/flang-openmp-version-macro.f90
1 parent 6d8995a commit 71a0d75

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

flang/include/flang/Tools/CrossToolHelpers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ struct OffloadModuleOpts {
164164
bool OpenMPIsTargetDevice = false;
165165
bool OpenMPIsGPU = false;
166166
bool OpenMPForceUSM = false;
167-
uint32_t OpenMPVersion = 11;
167+
uint32_t OpenMPVersion = 52;
168168
std::string OMPHostIRFile = {};
169169
std::vector<llvm::Triple> OMPTargetTriples = {};
170170
bool NoGPULib = false;

flang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,8 +1015,8 @@ static bool parseOpenMPArgs(CompilerInvocation &res, llvm::opt::ArgList &args,
10151015
unsigned numErrorsBefore = diags.getNumErrors();
10161016
llvm::Triple t(res.getTargetOpts().triple);
10171017

1018-
// By default OpenMP is set to 1.1 version
1019-
res.getLangOpts().OpenMPVersion = 11;
1018+
// By default OpenMP is set to 5.2 version
1019+
res.getLangOpts().OpenMPVersion = 52;
10201020
res.getFrontendOpts().features.Enable(
10211021
Fortran::common::LanguageFeature::OpenMP);
10221022
if (int Version = getLastArgIntValue(

flang/test/Driver/bbc-openmp-version-macro.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
! RUN: bbc -fopenmp -fopenmp-version=51 -o - %s | FileCheck %s --check-prefix=OPENMP-VERSION-51
1414
! RUN: bbc -fopenmp -fopenmp-version=52 -o - %s | FileCheck %s --check-prefix=OPENMP-VERSION-52
1515

16-
! DEFAULT-OPENMP-VERSION: {{.*}} = arith.constant 199911 : i32
16+
! DEFAULT-OPENMP-VERSION: {{.*}} = arith.constant 202111 : i32
1717
! OPENMP-VERSION-11: {{.*}} = arith.constant 199911 : i32
1818
! OPENMP-VERSION-20: {{.*}} = arith.constant 200011 : i32
1919
! OPENMP-VERSION-25: {{.*}} = arith.constant 200505 : i32

flang/test/Driver/flang-openmp-version-macro.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
! RUN: %flang_fc1 -fopenmp -fopenmp-version=51 -cpp -E %s | FileCheck %s --check-prefix=OPENMP-VERSION-51
1414
! RUN: %flang_fc1 -fopenmp -fopenmp-version=52 -cpp -E %s | FileCheck %s --check-prefix=OPENMP-VERSION-52
1515

16-
! DEFAULT-OPENMP-VERSION: integer :: var1 = 199911
16+
! DEFAULT-OPENMP-VERSION: integer :: var1 = 202111
1717
! OPENMP-VERSION-11: integer :: var1 = 199911
1818
! OPENMP-VERSION-20: integer :: var1 = 200011
1919
! OPENMP-VERSION-25: integer :: var1 = 200505

flang/test/Lower/OpenMP/rtl-flags.f90

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@
2020
!RUN: bbc -emit-hlfir -fopenmp -fopenmp-assume-no-nested-parallelism -fopenmp-is-target-device -o - %s | FileCheck %s --check-prefix=NEST-PAR-DEVICE-FIR
2121
!RUN: bbc -emit-hlfir -fopenmp -fopenmp-target-debug=1 -fopenmp-assume-teams-oversubscription -fopenmp-assume-no-nested-parallelism -fopenmp-assume-threads-oversubscription -fopenmp-assume-no-thread-state -fopenmp-is-target-device -o - %s | FileCheck %s --check-prefix=ALL-DEVICE-FIR
2222

23-
!DEFAULT-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<openmp_device_version = 11>
23+
!DEFAULT-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<openmp_device_version = 52>
2424
!DEFAULT-DEVICE-FIR-SAME: omp.is_target_device = true
2525
!DEFAULT-DEVICE-FIR-VERSION: module attributes {{{.*}}omp.flags = #omp.flags<openmp_device_version = 45>
2626
!DEFAULT-DEVICE-FIR-VERSION-SAME: omp.is_target_device = true
2727
!DEFAULT-DEVICE-FIR-VERSION-SAME: omp.version = #omp.version<version = 45>
2828
!DEFAULT-HOST-FIR: module attributes {{{.*}}omp.is_target_device = false{{.*}}
2929
!DEFAULT-HOST-FIR-VERSION: module attributes {{{.*}}omp.is_target_device = false
3030
!DEFAULT-HOST-FIR-VERSION-SAME: omp.version = #omp.version<version = 45>
31-
!DBG-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<debug_kind = 1, openmp_device_version = 11>
32-
!DBG-EQ-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<debug_kind = 111, openmp_device_version = 11>
33-
!TEAMS-OSUB-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<assume_teams_oversubscription = true, openmp_device_version = 11>
34-
!THREAD-OSUB-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<assume_threads_oversubscription = true, openmp_device_version = 11>
35-
!THREAD-STATE-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<assume_no_thread_state = true, openmp_device_version = 11>
36-
!NEST-PAR-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<assume_no_nested_parallelism = true, openmp_device_version = 11>
37-
!ALL-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<debug_kind = 1, assume_teams_oversubscription = true, assume_threads_oversubscription = true, assume_no_thread_state = true, assume_no_nested_parallelism = true, openmp_device_version = 11>
31+
!DBG-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<debug_kind = 1, openmp_device_version = 52>
32+
!DBG-EQ-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<debug_kind = 111, openmp_device_version = 52>
33+
!TEAMS-OSUB-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<assume_teams_oversubscription = true, openmp_device_version = 52>
34+
!THREAD-OSUB-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<assume_threads_oversubscription = true, openmp_device_version = 52>
35+
!THREAD-STATE-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<assume_no_thread_state = true, openmp_device_version = 52>
36+
!NEST-PAR-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<assume_no_nested_parallelism = true, openmp_device_version = 52>
37+
!ALL-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<debug_kind = 1, assume_teams_oversubscription = true, assume_threads_oversubscription = true, assume_no_thread_state = true, assume_no_nested_parallelism = true, openmp_device_version = 52>
3838
subroutine omp_subroutine()
3939
end subroutine omp_subroutine

flang/tools/bbc/bbc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ static llvm::cl::list<std::string> targetTriplesOpenMP(
167167
static llvm::cl::opt<uint32_t>
168168
setOpenMPVersion("fopenmp-version",
169169
llvm::cl::desc("OpenMP standard version"),
170-
llvm::cl::init(11));
170+
llvm::cl::init(52));
171171

172172
static llvm::cl::opt<uint32_t> setOpenMPTargetDebug(
173173
"fopenmp-target-debug",

0 commit comments

Comments
 (0)