llvm-project
91 строка · 2.0 Кб
1; RUN: llvm-as < %s -disable-output 2>&1 | FileCheck %s -allow-empty
2
3; RUN: llvm-as < %s | llvm-dis > %t1.ll
4; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
5; RUN: diff %t1.ll %t2.ll
6
7; RUN: llvm-as < %t1.ll -disable-output 2>&1 | FileCheck %s -allow-empty
8
9; CHECK-NOT: error
10; CHECK-NOT: warning
11
12define void @mixed1() {
13call void @g() ; not convergent
14call void @f() ; uncontrolled convergent
15call void @g() ; not convergent
16ret void
17}
18
19define void @mixed2() {
20call void @g() ; not convergent
21%t1_tok1 = call token @llvm.experimental.convergence.anchor()
22call void @f() [ "convergencectrl"(token %t1_tok1) ]
23call void @g() ; not convergent
24ret void
25}
26
27
28define void @region_nesting1() convergent {
29A:
30%tok1 = call token @llvm.experimental.convergence.entry()
31%tok2 = call token @llvm.experimental.convergence.anchor()
32br label %B
33
34B:
35br i1 undef, label %C, label %D
36
37C:
38call void @f() [ "convergencectrl"(token %tok1) ]
39ret void
40
41D:
42call void @f() [ "convergencectrl"(token %tok2) ]
43ret void
44}
45
46; Mirror image of @region_nesting1
47define void @region_nesting2() {
48A:
49%tok1 = call token @llvm.experimental.convergence.anchor()
50%tok2 = call token @llvm.experimental.convergence.anchor()
51br label %B
52
53B:
54br i1 undef, label %C, label %D
55
56C:
57call void @f() [ "convergencectrl"(token %tok2) ]
58ret void
59
60D:
61call void @f() [ "convergencectrl"(token %tok1) ]
62ret void
63}
64
65define void @loop_nesting() convergent {
66A:
67%a = call token @llvm.experimental.convergence.entry()
68br label %B
69
70B:
71%b = call token @llvm.experimental.convergence.anchor()
72br i1 undef, label %C, label %D
73
74C:
75%c = call token @llvm.experimental.convergence.loop() [ "convergencectrl"(token %b) ]
76call void @f() [ "convergencectrl"(token %c) ]
77br label %B
78
79D:
80call void @f() [ "convergencectrl"(token %b) ]
81br i1 undef, label %B, label %E
82
83E:
84ret void
85}
86declare void @f() convergent
87declare void @g()
88
89declare token @llvm.experimental.convergence.entry()
90declare token @llvm.experimental.convergence.anchor()
91declare token @llvm.experimental.convergence.loop()
92