[clang] d2850ba - [Clang] Accept 'noconvergent' attributes outside of CUDA (#205247)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 23 06:07:55 PDT 2026
Author: Joseph Huber
Date: 2026-06-23T08:07:49-05:00
New Revision: d2850baf0ad99c662e224bb522aebdeb09ff8e1b
URL: https://github.com/llvm/llvm-project/commit/d2850baf0ad99c662e224bb522aebdeb09ff8e1b
DIFF: https://github.com/llvm/llvm-project/commit/d2850baf0ad99c662e224bb522aebdeb09ff8e1b.diff
LOG: [Clang] Accept 'noconvergent' attributes outside of CUDA (#205247)
Summary:
There is no reason that `convergent` should be a generic attributes but
not `noconvergent`.
Added:
Modified:
clang/include/clang/Basic/Attr.td
clang/test/CodeGen/convergent-functions.cpp
Removed:
################################################################################
diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td
index 12bc0732fc19e..f1ae66bd7f2bb 100644
--- a/clang/include/clang/Basic/Attr.td
+++ b/clang/include/clang/Basic/Attr.td
@@ -2391,7 +2391,6 @@ def NoConvergent : InheritableAttr {
let Spellings = [Clang<"noconvergent">, Declspec<"noconvergent">];
let Subjects = SubjectList<[Function, Stmt], WarnDiag,
"functions and statements">;
- let LangOpts = [CUDA];
let Documentation = [NoConvergentDocs];
let SimpleHandler = 1;
}
diff --git a/clang/test/CodeGen/convergent-functions.cpp b/clang/test/CodeGen/convergent-functions.cpp
index 7290c505ec6fe..8734054462e19 100644
--- a/clang/test/CodeGen/convergent-functions.cpp
+++ b/clang/test/CodeGen/convergent-functions.cpp
@@ -3,8 +3,17 @@
// Test that the -fconvergent-functions flag works
-// CHECK: attributes #0 = {
+// CHECK: define {{.*}} @func() #[[ATTR:[0-9]+]]
+void func(void) { }
+
+// CONVFUNC: define {{.*}} @nofunc() #[[NOATTR:[0-9]+]]
+__attribute__((noconvergent)) void nofunc(void) { }
+
+// CHECK: attributes #[[ATTR]] = {
// NOCONVFUNC-NOT: convergent
// CONVFUNC-SAME: convergent
// CHECK-SAME: }
-void func(void) { }
+
+// CONVFUNC: attributes #[[NOATTR]] = {
+// CONVFUNC-NOT: convergent
+// CONVFUNC-SAME: }
More information about the cfe-commits
mailing list