xref: /llvm-project/llvm/test/Transforms/FunctionImport/Inputs/adjustable_threshold.ll (revision cee313d288a4faf0355d76fb6e0e927e211d08a5)
1*cee313d2SEric Christopherdefine void @globalfunc1() {
2*cee313d2SEric Christopherentry:
3*cee313d2SEric Christopher  call void @trampoline()
4*cee313d2SEric Christopher  ret void
5*cee313d2SEric Christopher}
6*cee313d2SEric Christopher; Adds an artificial level in the call graph to reduce the importing threshold
7*cee313d2SEric Christopherdefine void @trampoline() {
8*cee313d2SEric Christopherentry:
9*cee313d2SEric Christopher  call void @largefunction()
10*cee313d2SEric Christopher  ret void
11*cee313d2SEric Christopher}
12*cee313d2SEric Christopher
13*cee313d2SEric Christopherdefine void @globalfunc2() {
14*cee313d2SEric Christopherentry:
15*cee313d2SEric Christopher  call void @largefunction()
16*cee313d2SEric Christopher  ret void
17*cee313d2SEric Christopher}
18*cee313d2SEric Christopher
19*cee313d2SEric Christopher
20*cee313d2SEric Christopher; Size is 5: if two layers below in the call graph the threshold will be 4,
21*cee313d2SEric Christopher; but if only one layer below the threshold will be 7.
22*cee313d2SEric Christopherdefine void @largefunction() {
23*cee313d2SEric Christopher  entry:
24*cee313d2SEric Christopher  call void @staticfunc2()
25*cee313d2SEric Christopher  call void @staticfunc2()
26*cee313d2SEric Christopher  call void @staticfunc2()
27*cee313d2SEric Christopher  call void @staticfunc2()
28*cee313d2SEric Christopher  call void @staticfunc2()
29*cee313d2SEric Christopher  ret void
30*cee313d2SEric Christopher}
31*cee313d2SEric Christopher
32*cee313d2SEric Christopherdefine internal void @staticfunc2() {
33*cee313d2SEric Christopherentry:
34*cee313d2SEric Christopher  ret void
35*cee313d2SEric Christopher}
36*cee313d2SEric Christopher
37*cee313d2SEric Christopher
38