From f6657601629005cc9e488f159e310ae4008a25ea Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Mon, 24 Apr 2023 09:10:31 -0500 Subject: [Clang] Accept and forward `-fconvergent-functions` in the driver Currently the `-fconvergent-functions` option is primarily used by GPU toolchains to enforce convergent operations in line with the semantics. This option previously was only supported via `-Xclang` and would show up as unused if passed to the driver. This patch allows the driver to forward it. This is mostly useful for users wishing to target GPU toolchains directly via `--target=` without an offloading runtime. Reviewed By: JonChesterfield, MaskRay Differential Revision: https://reviews.llvm.org/D149019 --- clang/lib/Frontend/CompilerInvocation.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index cb29049..34e0e8d 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -3731,9 +3731,9 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args, Opts.Blocks = Args.hasArg(OPT_fblocks) || (Opts.OpenCL && Opts.OpenCLVersion == 200); - Opts.ConvergentFunctions = Opts.OpenCL || (Opts.CUDA && Opts.CUDAIsDevice) || - Opts.SYCLIsDevice || - Args.hasArg(OPT_fconvergent_functions); + Opts.ConvergentFunctions = Args.hasArg(OPT_fconvergent_functions) || + Opts.OpenCL || (Opts.CUDA && Opts.CUDAIsDevice) || + Opts.SYCLIsDevice; Opts.NoBuiltin = Args.hasArg(OPT_fno_builtin) || Opts.Freestanding; if (!Opts.NoBuiltin) -- cgit v1.1