aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorShilei Tian <tianshilei1992@gmail.com>2021-02-03 20:57:59 -0500
committerShilei Tian <tianshilei1992@gmail.com>2021-02-03 20:58:12 -0500
commit0f0ce3c12edefd25448e39c4d20718a10d3d42c1 (patch)
treede49915e7b4cae570dc623d92e048c13c4f2f7bd /clang/lib/Frontend/CompilerInvocation.cpp
parent26b5be66f9c540028136f4fb4538c5786104abb9 (diff)
downloadllvm-0f0ce3c12edefd25448e39c4d20718a10d3d42c1.zip
llvm-0f0ce3c12edefd25448e39c4d20718a10d3d42c1.tar.gz
llvm-0f0ce3c12edefd25448e39c4d20718a10d3d42c1.tar.bz2
[OpenMP][NVPTX] Take functions in `deviceRTLs` as `convergent`
OpenMP device compiler (similar to other SPMD compilers) assumes that functions are convergent by default to avoid invalid transformations, such as the bug (https://bugs.llvm.org/show_bug.cgi?id=49021). Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D95971
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 2f712ed..6dff00d 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -2441,6 +2441,8 @@ void CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
bool IsTargetSpecified =
Opts.OpenMPIsDevice || Args.hasArg(options::OPT_fopenmp_targets_EQ);
+ Opts.ConvergentFunctions = Opts.ConvergentFunctions || Opts.OpenMPIsDevice;
+
if (Opts.OpenMP || Opts.OpenMPSimd) {
if (int Version = getLastArgIntValue(
Args, OPT_fopenmp_version_EQ,