aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorSergio Afonso <safonsof@amd.com>2024-06-05 14:43:58 +0100
committerGitHub <noreply@github.com>2024-06-05 14:43:58 +0100
commitb9549261e218cee2ad1305fb7272b831799b7bfe (patch)
treecef452b98357c93b1b4546daf3a70cfd73a3c3b3 /flang/lib/Frontend/CompilerInvocation.cpp
parent79e09b1555a51cc8d02d0225ed6d81a21fa09eca (diff)
downloadllvm-b9549261e218cee2ad1305fb7272b831799b7bfe.zip
llvm-b9549261e218cee2ad1305fb7272b831799b7bfe.tar.gz
llvm-b9549261e218cee2ad1305fb7272b831799b7bfe.tar.bz2
[Flang][OpenMP] Add -fopenmp-force-usm option to flang (#94359)
This patch enables the `-fopenmp-force-usm` option to be passed to the flang driver, which forwards it to the compiler frontend. This flag, when set, results in the introduction of the `unified_shared_memory` bit to the `omp.requires` attribute of the top-level module operation. This is later combined with any other target device-related REQUIRES clauses that may have been explicitly set in the compilation unit.
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--flang/lib/Frontend/CompilerInvocation.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp
index 50c3e8b..f64a939 100644
--- a/flang/lib/Frontend/CompilerInvocation.cpp
+++ b/flang/lib/Frontend/CompilerInvocation.cpp
@@ -906,6 +906,9 @@ static bool parseDialectArgs(CompilerInvocation &res, llvm::opt::ArgList &args,
res.getLangOpts().OpenMPVersion, diags)) {
res.getLangOpts().OpenMPVersion = Version;
}
+ if (args.hasArg(clang::driver::options::OPT_fopenmp_force_usm)) {
+ res.getLangOpts().OpenMPForceUSM = 1;
+ }
if (args.hasArg(clang::driver::options::OPT_fopenmp_is_target_device)) {
res.getLangOpts().OpenMPIsTargetDevice = 1;