xref: /llvm-project/llvm/test/Other/cgscc-refscc-mutation-order.ll (revision 71497cc7a4695d22fc5dfd64958744816c15a19e)
1; RUN: opt -passes='cgscc(function(instcombine))' -debug-pass-manager -disable-output < %s 2>&1 | FileCheck %s
2
3; We want to run passes on every SCC in a RefSCC without bailing even if one of the SCCs becomes a child SCC.
4
5; This prevents explosive behavior on huge RefSCCs where a non-trivial amount of
6; SCCs in the RefSCC become their own RefSCC as passes run on them. Otherwise we
7; end up visiting the huge RefSCC the number of times that an SCC is split out
8; rather than just twice.
9
10; CHECK: Running pass: InstCombinePass on f1
11; CHECK-NOT: InstCombinePass
12; CHECK: Running pass: InstCombinePass on f2
13; CHECK-NOT: InstCombinePass
14; CHECK: Running pass: InstCombinePass on f3
15; CHECK-NOT: InstCombinePass
16; CHECK: Running pass: InstCombinePass on f4
17; CHECK-NOT: InstCombinePass
18
19@a1 = alias void (), ptr @f1
20@a2 = alias void (), ptr @f2
21@a3 = alias void (), ptr @f3
22@a4 = alias void (), ptr @f4
23
24define void @f1() {
25  call void @a2()
26  call void @a3()
27  call void @a4()
28  ret void
29}
30
31define void @f2() {
32  call void @a1() readnone nounwind willreturn
33  ret void
34}
35
36define void @f3() {
37  call void @a1() readnone nounwind willreturn
38  ret void
39}
40
41define void @f4() {
42  call void @a1() readnone nounwind willreturn
43  ret void
44}
45