[llvm] [IR] Relax convergence requirements on call (PR #135794)

Nathan Gauër via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 28 01:42:30 PDT 2025


https://github.com/Keenuts updated https://github.com/llvm/llvm-project/pull/135794

>From 074125a424fda18010a3c1d2f88a2e603158f75c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?= <brioche at google.com>
Date: Tue, 15 Apr 2025 15:34:06 +0200
Subject: [PATCH 1/5] [IR] Relax convergence requirements on call

Before this commit, having a convergence token on a non-convergent
call was considered to be an error.
This commit relaxes this requirement and allows convergence tokens
to be present on non-convergent calls.

When such token is present, they have no effect as the underlying
call is non-convergent.
This allows passes like DCE to strip `convergent` attribute from
functions for which all convergent operations have been stripped.
When this happens, a convergence token can still exist in the
call-site, causing the verifier to complain.

Alternatives have been considered in #134863 and #134844.
---
 .../llvm/IR/GenericConvergenceVerifierImpl.h  |  3 -
 llvm/test/Transforms/ADCE/convergence.ll      | 92 +++++++++++++++++++
 llvm/test/Transforms/BDCE/convergence.ll      | 62 +++++++++++++
 .../Transforms/FunctionAttrs/convergent.ll    | 29 ++++++
 llvm/test/Verifier/convergencectrl-invalid.ll |  2 +-
 5 files changed, 184 insertions(+), 4 deletions(-)
 create mode 100644 llvm/test/Transforms/ADCE/convergence.ll
 create mode 100644 llvm/test/Transforms/BDCE/convergence.ll

diff --git a/llvm/include/llvm/IR/GenericConvergenceVerifierImpl.h b/llvm/include/llvm/IR/GenericConvergenceVerifierImpl.h
index e076ac4a14162..ddcce17b77c8b 100644
--- a/llvm/include/llvm/IR/GenericConvergenceVerifierImpl.h
+++ b/llvm/include/llvm/IR/GenericConvergenceVerifierImpl.h
@@ -102,9 +102,6 @@ void GenericConvergenceVerifier<ContextT>::visit(const InstructionT &I) {
     SeenFirstConvOp = true;
 
   if (TokenDef || ConvOp != CONV_NONE) {
-    Check(isConvergent(I),
-          "Convergence control token can only be used in a convergent call.",
-          {Context.print(&I)});
     Check(ConvergenceKind != UncontrolledConvergence,
           "Cannot mix controlled and uncontrolled convergence in the same "
           "function.",
diff --git a/llvm/test/Transforms/ADCE/convergence.ll b/llvm/test/Transforms/ADCE/convergence.ll
new file mode 100644
index 0000000000000..5d7b9bd65c821
--- /dev/null
+++ b/llvm/test/Transforms/ADCE/convergence.ll
@@ -0,0 +1,92 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
+; RUN: opt %s -passes=adce -S | FileCheck %s
+
+; CHECK:      Function Attrs: convergent
+define i32 @foo(i32 %a) #0 {
+; CHECK-LABEL: define i32 @foo(
+; CHECK-SAME: i32 [[A:%.*]]) #[[ATTR0:[0-9]+]] {
+; CHECK-NEXT:  [[ENTRY:.*:]]
+; CHECK-NEXT:    ret i32 [[A]]
+;
+entry:
+  %tk = call token @llvm.experimental.convergence.entry()
+  ret i32 %a
+}
+
+; CHECK:      Function Attrs: convergent
+define void @bar() #0 {
+; CHECK-LABEL: define void @bar(
+; CHECK-SAME: ) #[[ATTR0]] {
+; CHECK-NEXT:  [[ENTRY:.*:]]
+; CHECK-NEXT:    ret void
+;
+entry:
+  %tk = call token @llvm.experimental.convergence.anchor()
+  ret void
+}
+
+; CHECK:      Function Attrs: convergent
+define void @baz() #0 {
+; CHECK-LABEL: define void @baz(
+; CHECK-SAME: ) #[[ATTR0]] {
+; CHECK-NEXT:  [[ENTRY:.*:]]
+; CHECK-NEXT:    br label %[[HEADER:.*]]
+; CHECK:       [[HEADER]]:
+; CHECK-NEXT:    br i1 true, label %[[BODY:.*]], label %[[EXIT:.*]]
+; CHECK:       [[BODY]]:
+; CHECK-NEXT:    br label %[[HEADER]]
+; CHECK:       [[EXIT]]:
+; CHECK-NEXT:    ret void
+;
+entry:
+  %tk0 = call token @llvm.experimental.convergence.entry()
+  br label %header
+
+header:
+  %tk1 = call token @llvm.experimental.convergence.loop() [ "convergencectrl"(token %tk0) ]
+  br i1 true, label %body, label %exit
+
+body:
+  br label %header
+
+exit:
+  ret void
+}
+
+define void @indirect_inner() #0 {
+; CHECK-LABEL: define void @indirect_inner(
+; CHECK-SAME: ) #[[ATTR0]] {
+; CHECK-NEXT:  [[ENTRY:.*:]]
+; CHECK-NEXT:    ret void
+;
+entry:
+  %tk0 = call token @llvm.experimental.convergence.entry()
+  ret void
+}
+
+define void @indirect() #0 {
+; CHECK-LABEL: define void @indirect(
+; CHECK-SAME: ) #[[ATTR0]] {
+; CHECK-NEXT:  [[ENTRY:.*:]]
+; CHECK-NEXT:    [[TK0:%.*]] = call token @llvm.experimental.convergence.entry()
+; CHECK-NEXT:    [[VAR:%.*]] = alloca ptr, align 8
+; CHECK-NEXT:    store ptr @indirect_inner, ptr [[VAR]], align 8
+; CHECK-NEXT:    [[PTR:%.*]] = load ptr, ptr [[VAR]], align 8
+; CHECK-NEXT:    call void [[PTR]]() #[[ATTR0]] [ "convergencectrl"(token [[TK0]]) ]
+; CHECK-NEXT:    ret void
+;
+entry:
+  %tk0 = call token @llvm.experimental.convergence.entry()
+  %var = alloca ptr, align 8
+  store ptr @indirect_inner, ptr %var, align 8
+  %ptr = load ptr, ptr %var, align 8
+  call void %ptr() convergent [ "convergencectrl"(token %tk0) ]
+  ret void
+}
+
+declare token @llvm.experimental.convergence.entry() #1
+declare token @llvm.experimental.convergence.anchor() #1
+declare token @llvm.experimental.convergence.loop() #1
+
+attributes #0 = { convergent }
+attributes #1 = { convergent nocallback nofree nosync nounwind willreturn memory(none) }
diff --git a/llvm/test/Transforms/BDCE/convergence.ll b/llvm/test/Transforms/BDCE/convergence.ll
new file mode 100644
index 0000000000000..51f279925b9f7
--- /dev/null
+++ b/llvm/test/Transforms/BDCE/convergence.ll
@@ -0,0 +1,62 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
+; RUN: opt %s -passes=bdce -S | FileCheck %s
+
+; CHECK:      Function Attrs: convergent
+define i32 @foo(i32 %a) #0 {
+; CHECK-LABEL: define i32 @foo(
+; CHECK-SAME: i32 [[A:%.*]]) #[[ATTR0:[0-9]+]] {
+; CHECK-NEXT:  [[ENTRY:.*:]]
+; CHECK-NEXT:    ret i32 [[A]]
+;
+entry:
+  %tk0 = call token @llvm.experimental.convergence.entry()
+  ret i32 %a
+}
+
+; CHECK:      Function Attrs: convergent
+define void @bar() #0 {
+; CHECK-LABEL: define void @bar(
+; CHECK-SAME: ) #[[ATTR0]] {
+; CHECK-NEXT:  [[ENTRY:.*:]]
+; CHECK-NEXT:    ret void
+;
+entry:
+  %tk0 = call token @llvm.experimental.convergence.anchor()
+  ret void
+}
+
+; CHECK:      Function Attrs: convergent
+define void @baz() #0 {
+; CHECK-LABEL: define void @baz(
+; CHECK-SAME: ) #[[ATTR0]] {
+; CHECK-NEXT:  [[ENTRY:.*:]]
+; CHECK-NEXT:    br label %[[HEADER:.*]]
+; CHECK:       [[HEADER]]:
+; CHECK-NEXT:    br i1 true, label %[[BODY:.*]], label %[[EXIT:.*]]
+; CHECK:       [[BODY]]:
+; CHECK-NEXT:    br label %[[HEADER]]
+; CHECK:       [[EXIT]]:
+; CHECK-NEXT:    ret void
+;
+entry:
+  %tk0 = call token @llvm.experimental.convergence.entry()
+  br label %header
+
+header:
+  %tk1 = call token @llvm.experimental.convergence.loop() [ "convergencectrl"(token %tk0) ]
+  br i1 true, label %body, label %exit
+
+body:
+  br label %header
+
+exit:
+  ret void
+}
+
+declare token @llvm.experimental.convergence.entry() #1
+declare token @llvm.experimental.convergence.anchor() #1
+declare token @llvm.experimental.convergence.loop() #1
+
+attributes #0 = { convergent }
+attributes #1 = { convergent nocallback nofree nosync nounwind willreturn memory(none) }
+
diff --git a/llvm/test/Transforms/FunctionAttrs/convergent.ll b/llvm/test/Transforms/FunctionAttrs/convergent.ll
index fe8029d39d924..409934191c3ca 100644
--- a/llvm/test/Transforms/FunctionAttrs/convergent.ll
+++ b/llvm/test/Transforms/FunctionAttrs/convergent.ll
@@ -129,3 +129,32 @@ define i32 @noopt_friend() convergent {
   %a = call i32 @noopt()
   ret i32 0
 }
+
+
+; A function which is stripped of its convergent attribute, even
+; if used in a controlled convergence call.
+; This should be OK.
+define i32 @leaf_noconvergent_used() convergent {
+; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
+; CHECK-LABEL: define {{[^@]+}}@leaf_noconvergent_used
+; CHECK-SAME: () #[[ATTR0]] {
+; CHECK-NEXT:    ret i32 0
+;
+  ret i32 0
+}
+
+define i32 @nonleaf_convergent() convergent {
+; CHECK: Function Attrs: convergent mustprogress nofree norecurse nosync nounwind willreturn memory(none)
+; CHECK-LABEL: define {{[^@]+}}@nonleaf_convergent
+; CHECK-SAME: () #[[ATTR7:[0-9]+]] {
+; CHECK-NEXT:    [[TMP1:%.*]] = call token @llvm.experimental.convergence.entry()
+; CHECK-NEXT:    [[TMP2:%.*]] = call i32 @leaf_noconvergent_used() [ "convergencectrl"(token [[TMP1]]) ]
+; CHECK-NEXT:    ret i32 0
+;
+  %1 = call token @llvm.experimental.convergence.entry()
+  %2 = call i32 @leaf_noconvergent_used() [ "convergencectrl"(token %1) ]
+  ret i32 0
+}
+
+
+declare token @llvm.experimental.convergence.entry() #1
diff --git a/llvm/test/Verifier/convergencectrl-invalid.ll b/llvm/test/Verifier/convergencectrl-invalid.ll
index e1fffcd1c6033..75c33760fa0e5 100644
--- a/llvm/test/Verifier/convergencectrl-invalid.ll
+++ b/llvm/test/Verifier/convergencectrl-invalid.ll
@@ -20,7 +20,7 @@ define void @wrong_token() {
   ret void
 }
 
-; CHECK: Convergence control token can only be used in a convergent call.
+; convergence control token can be used on non-convergent calls, but it has no effect.
 ; CHECK-NEXT  call void @g(){{.*}}%t05_tok1
 define void @missing.attribute() {
   %t05_tok1 = call token @llvm.experimental.convergence.anchor()

>From e631ea0ce9f13f5c5f4e6d9ed1d9e0be22f6ab58 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?= <brioche at google.com>
Date: Tue, 22 Apr 2025 10:05:42 +0200
Subject: [PATCH 2/5] pr-feedback: use --check-attributes

---
 llvm/test/Transforms/ADCE/convergence.ll | 10 ++++++----
 llvm/test/Transforms/BDCE/convergence.ll |  8 ++++----
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/llvm/test/Transforms/ADCE/convergence.ll b/llvm/test/Transforms/ADCE/convergence.ll
index 5d7b9bd65c821..a677350c26391 100644
--- a/llvm/test/Transforms/ADCE/convergence.ll
+++ b/llvm/test/Transforms/ADCE/convergence.ll
@@ -1,8 +1,8 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-attributes --version 5
 ; RUN: opt %s -passes=adce -S | FileCheck %s
 
-; CHECK:      Function Attrs: convergent
 define i32 @foo(i32 %a) #0 {
+; CHECK: Function Attrs: convergent
 ; CHECK-LABEL: define i32 @foo(
 ; CHECK-SAME: i32 [[A:%.*]]) #[[ATTR0:[0-9]+]] {
 ; CHECK-NEXT:  [[ENTRY:.*:]]
@@ -13,8 +13,8 @@ entry:
   ret i32 %a
 }
 
-; CHECK:      Function Attrs: convergent
 define void @bar() #0 {
+; CHECK: Function Attrs: convergent
 ; CHECK-LABEL: define void @bar(
 ; CHECK-SAME: ) #[[ATTR0]] {
 ; CHECK-NEXT:  [[ENTRY:.*:]]
@@ -25,8 +25,8 @@ entry:
   ret void
 }
 
-; CHECK:      Function Attrs: convergent
 define void @baz() #0 {
+; CHECK: Function Attrs: convergent
 ; CHECK-LABEL: define void @baz(
 ; CHECK-SAME: ) #[[ATTR0]] {
 ; CHECK-NEXT:  [[ENTRY:.*:]]
@@ -54,6 +54,7 @@ exit:
 }
 
 define void @indirect_inner() #0 {
+; CHECK: Function Attrs: convergent
 ; CHECK-LABEL: define void @indirect_inner(
 ; CHECK-SAME: ) #[[ATTR0]] {
 ; CHECK-NEXT:  [[ENTRY:.*:]]
@@ -65,6 +66,7 @@ entry:
 }
 
 define void @indirect() #0 {
+; CHECK: Function Attrs: convergent
 ; CHECK-LABEL: define void @indirect(
 ; CHECK-SAME: ) #[[ATTR0]] {
 ; CHECK-NEXT:  [[ENTRY:.*:]]
diff --git a/llvm/test/Transforms/BDCE/convergence.ll b/llvm/test/Transforms/BDCE/convergence.ll
index 51f279925b9f7..f7de7e66b0e52 100644
--- a/llvm/test/Transforms/BDCE/convergence.ll
+++ b/llvm/test/Transforms/BDCE/convergence.ll
@@ -1,8 +1,8 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-attributes --version 5
 ; RUN: opt %s -passes=bdce -S | FileCheck %s
 
-; CHECK:      Function Attrs: convergent
 define i32 @foo(i32 %a) #0 {
+; CHECK: Function Attrs: convergent
 ; CHECK-LABEL: define i32 @foo(
 ; CHECK-SAME: i32 [[A:%.*]]) #[[ATTR0:[0-9]+]] {
 ; CHECK-NEXT:  [[ENTRY:.*:]]
@@ -13,8 +13,8 @@ entry:
   ret i32 %a
 }
 
-; CHECK:      Function Attrs: convergent
 define void @bar() #0 {
+; CHECK: Function Attrs: convergent
 ; CHECK-LABEL: define void @bar(
 ; CHECK-SAME: ) #[[ATTR0]] {
 ; CHECK-NEXT:  [[ENTRY:.*:]]
@@ -25,8 +25,8 @@ entry:
   ret void
 }
 
-; CHECK:      Function Attrs: convergent
 define void @baz() #0 {
+; CHECK: Function Attrs: convergent
 ; CHECK-LABEL: define void @baz(
 ; CHECK-SAME: ) #[[ATTR0]] {
 ; CHECK-NEXT:  [[ENTRY:.*:]]

>From 3feef8edb6d3117b456047197299df91f28980d3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?= <brioche at google.com>
Date: Wed, 23 Apr 2025 14:07:04 +0200
Subject: [PATCH 3/5] move test to llvm/test/Assembler

---
 llvm/test/Assembler/convergence-control.ll    | 7 +++++++
 llvm/test/Verifier/convergencectrl-invalid.ll | 8 --------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/llvm/test/Assembler/convergence-control.ll b/llvm/test/Assembler/convergence-control.ll
index f32f4a9f53707..c7dd04cf5c25b 100644
--- a/llvm/test/Assembler/convergence-control.ll
+++ b/llvm/test/Assembler/convergence-control.ll
@@ -24,6 +24,13 @@ define void @mixed2() {
   ret void
 }
 
+; convergence control token can be used on non-convergent calls,
+; but it has no effect.
+define void @mixed3() {
+  %t05_tok1 = call token @llvm.experimental.convergence.anchor()
+  call void @g() [ "convergencectrl"(token %t05_tok1) ]
+  ret void
+}
 
 define void @region_nesting1(i1 %arg) convergent {
 A:
diff --git a/llvm/test/Verifier/convergencectrl-invalid.ll b/llvm/test/Verifier/convergencectrl-invalid.ll
index 75c33760fa0e5..907c3464ffce9 100644
--- a/llvm/test/Verifier/convergencectrl-invalid.ll
+++ b/llvm/test/Verifier/convergencectrl-invalid.ll
@@ -20,14 +20,6 @@ define void @wrong_token() {
   ret void
 }
 
-; convergence control token can be used on non-convergent calls, but it has no effect.
-; CHECK-NEXT  call void @g(){{.*}}%t05_tok1
-define void @missing.attribute() {
-  %t05_tok1 = call token @llvm.experimental.convergence.anchor()
-  call void @g() [ "convergencectrl"(token %t05_tok1) ]
-  ret void
-}
-
 ; CHECK: The 'convergencectrl' bundle requires exactly one token use.
 ; CHECK-NEXT:  call void @g()
 define void @multiple_tokens() {

>From e0653502b985b4ed8cd280b98a2dd10aa5aa5dd6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?= <brioche at google.com>
Date: Wed, 23 Apr 2025 14:11:10 +0200
Subject: [PATCH 4/5] replace --check-attributes with --check-globals for tests

---
 llvm/test/Transforms/ADCE/convergence.ll | 11 +++++------
 llvm/test/Transforms/BDCE/convergence.ll | 10 +++++-----
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/llvm/test/Transforms/ADCE/convergence.ll b/llvm/test/Transforms/ADCE/convergence.ll
index a677350c26391..01a205ebda148 100644
--- a/llvm/test/Transforms/ADCE/convergence.ll
+++ b/llvm/test/Transforms/ADCE/convergence.ll
@@ -1,8 +1,7 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-attributes --version 5
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals all --version 5
 ; RUN: opt %s -passes=adce -S | FileCheck %s
 
 define i32 @foo(i32 %a) #0 {
-; CHECK: Function Attrs: convergent
 ; CHECK-LABEL: define i32 @foo(
 ; CHECK-SAME: i32 [[A:%.*]]) #[[ATTR0:[0-9]+]] {
 ; CHECK-NEXT:  [[ENTRY:.*:]]
@@ -14,7 +13,6 @@ entry:
 }
 
 define void @bar() #0 {
-; CHECK: Function Attrs: convergent
 ; CHECK-LABEL: define void @bar(
 ; CHECK-SAME: ) #[[ATTR0]] {
 ; CHECK-NEXT:  [[ENTRY:.*:]]
@@ -26,7 +24,6 @@ entry:
 }
 
 define void @baz() #0 {
-; CHECK: Function Attrs: convergent
 ; CHECK-LABEL: define void @baz(
 ; CHECK-SAME: ) #[[ATTR0]] {
 ; CHECK-NEXT:  [[ENTRY:.*:]]
@@ -54,7 +51,6 @@ exit:
 }
 
 define void @indirect_inner() #0 {
-; CHECK: Function Attrs: convergent
 ; CHECK-LABEL: define void @indirect_inner(
 ; CHECK-SAME: ) #[[ATTR0]] {
 ; CHECK-NEXT:  [[ENTRY:.*:]]
@@ -66,7 +62,6 @@ entry:
 }
 
 define void @indirect() #0 {
-; CHECK: Function Attrs: convergent
 ; CHECK-LABEL: define void @indirect(
 ; CHECK-SAME: ) #[[ATTR0]] {
 ; CHECK-NEXT:  [[ENTRY:.*:]]
@@ -92,3 +87,7 @@ declare token @llvm.experimental.convergence.loop() #1
 
 attributes #0 = { convergent }
 attributes #1 = { convergent nocallback nofree nosync nounwind willreturn memory(none) }
+;.
+; CHECK: attributes #[[ATTR0]] = { convergent }
+; CHECK: attributes #[[ATTR1:[0-9]+]] = { convergent nocallback nofree nosync nounwind willreturn memory(none) }
+;.
diff --git a/llvm/test/Transforms/BDCE/convergence.ll b/llvm/test/Transforms/BDCE/convergence.ll
index f7de7e66b0e52..5bebe37acc845 100644
--- a/llvm/test/Transforms/BDCE/convergence.ll
+++ b/llvm/test/Transforms/BDCE/convergence.ll
@@ -1,8 +1,7 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-attributes --version 5
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals all --version 5
 ; RUN: opt %s -passes=bdce -S | FileCheck %s
 
 define i32 @foo(i32 %a) #0 {
-; CHECK: Function Attrs: convergent
 ; CHECK-LABEL: define i32 @foo(
 ; CHECK-SAME: i32 [[A:%.*]]) #[[ATTR0:[0-9]+]] {
 ; CHECK-NEXT:  [[ENTRY:.*:]]
@@ -14,7 +13,6 @@ entry:
 }
 
 define void @bar() #0 {
-; CHECK: Function Attrs: convergent
 ; CHECK-LABEL: define void @bar(
 ; CHECK-SAME: ) #[[ATTR0]] {
 ; CHECK-NEXT:  [[ENTRY:.*:]]
@@ -26,7 +24,6 @@ entry:
 }
 
 define void @baz() #0 {
-; CHECK: Function Attrs: convergent
 ; CHECK-LABEL: define void @baz(
 ; CHECK-SAME: ) #[[ATTR0]] {
 ; CHECK-NEXT:  [[ENTRY:.*:]]
@@ -59,4 +56,7 @@ declare token @llvm.experimental.convergence.loop() #1
 
 attributes #0 = { convergent }
 attributes #1 = { convergent nocallback nofree nosync nounwind willreturn memory(none) }
-
+;.
+; CHECK: attributes #[[ATTR0]] = { convergent }
+; CHECK: attributes #[[ATTR1:[0-9]+]] = { convergent nocallback nofree nosync nounwind willreturn memory(none) }
+;.

>From 1e692b294a9c79bfb9c39c1314d7f3f62d6ce768 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?= <brioche at google.com>
Date: Mon, 28 Apr 2025 10:42:10 +0200
Subject: [PATCH 5/5] update FunctionAttr test to use check-globals

---
 llvm/test/Transforms/FunctionAttrs/convergent.ll | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/llvm/test/Transforms/FunctionAttrs/convergent.ll b/llvm/test/Transforms/FunctionAttrs/convergent.ll
index 409934191c3ca..49c357bd6bc86 100644
--- a/llvm/test/Transforms/FunctionAttrs/convergent.ll
+++ b/llvm/test/Transforms/FunctionAttrs/convergent.ll
@@ -1,4 +1,4 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
 ; RUN: opt -passes=function-attrs -S < %s | FileCheck %s
 
 define i32 @nonleaf() convergent {
@@ -158,3 +158,14 @@ define i32 @nonleaf_convergent() convergent {
 
 
 declare token @llvm.experimental.convergence.entry() #1
+;.
+; CHECK: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
+; CHECK: attributes #[[ATTR1]] = { convergent }
+; CHECK: attributes #[[ATTR2]] = { norecurse }
+; CHECK: attributes #[[ATTR3:[0-9]+]] = { convergent nocallback nounwind }
+; CHECK: attributes #[[ATTR4]] = { convergent norecurse nounwind }
+; CHECK: attributes #[[ATTR5]] = { nofree nosync nounwind memory(none) }
+; CHECK: attributes #[[ATTR6]] = { convergent noinline optnone }
+; CHECK: attributes #[[ATTR7]] = { convergent mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
+; CHECK: attributes #[[ATTR8:[0-9]+]] = { convergent nocallback nofree nosync nounwind willreturn memory(none) }
+;.



More information about the llvm-commits mailing list