[clang] [Clang] Automatically enable `-fconvergent-functions` on GPU targets (PR #111076)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 4 05:11:40 PDT 2024


================
@@ -4106,9 +4106,10 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
   Opts.Blocks = Args.hasArg(OPT_fblocks) || (Opts.OpenCL
     && Opts.OpenCLVersion == 200);
 
-  Opts.ConvergentFunctions = Args.hasArg(OPT_fconvergent_functions) ||
-                             Opts.OpenCL || (Opts.CUDA && Opts.CUDAIsDevice) ||
-                             Opts.SYCLIsDevice || Opts.HLSL;
+  Opts.ConvergentFunctions = Args.hasFlag(
+      OPT_fconvergent_functions, OPT_fno_convergent_functions,
+      Opts.OpenMPIsTargetDevice || T.isAMDGPU() || T.isNVPTX() || Opts.OpenCL ||
+          Opts.CUDAIsDevice || Opts.SYCLIsDevice || Opts.HLSL);
----------------
jhuber6 wrote:

Done, I just put it in a variable for now.

https://github.com/llvm/llvm-project/pull/111076


More information about the cfe-commits mailing list