diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -3737,7 +3737,7 @@ && Opts.OpenCLVersion == 200); Opts.ConvergentFunctions = Opts.OpenCL || (Opts.CUDA && Opts.CUDAIsDevice) || - Opts.SYCLIsDevice || + Opts.SYCLIsDevice || T.isNVPTX() || T.isAMDGPU() || Args.hasArg(OPT_fconvergent_functions); Opts.NoBuiltin = Args.hasArg(OPT_fno_builtin) || Opts.Freestanding; diff --git a/clang/test/CodeGen/nvptx_attributes.c b/clang/test/CodeGen/nvptx_attributes.c --- a/clang/test/CodeGen/nvptx_attributes.c +++ b/clang/test/CodeGen/nvptx_attributes.c @@ -1,7 +1,7 @@ // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals // RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -target-cpu sm_61 -emit-llvm %s -o - | FileCheck %s -// CHECK: Function Attrs: noinline nounwind optnone +// CHECK: Function Attrs: convergent noinline nounwind optnone // CHECK-LABEL: define {{[^@]+}}@foo // CHECK-SAME: (ptr noundef [[RET:%.*]]) #[[ATTR0:[0-9]+]] { // CHECK-NEXT: entry: