1*cee313d2SEric Christopher; Do setup work for all below tests: generate bitcode and combined index 2*cee313d2SEric Christopher; RUN: opt -module-summary %s -o %t.bc 3*cee313d2SEric Christopher; RUN: opt -module-summary %p/Inputs/adjustable_threshold.ll -o %t2.bc 4*cee313d2SEric Christopher; RUN: llvm-lto -thinlto -o %t3 %t.bc %t2.bc 5*cee313d2SEric Christopher 6*cee313d2SEric Christopher; Test import with default progressive instruction factor 7*cee313d2SEric Christopher; RUN: opt -function-import -summary-file %t3.thinlto.bc %t.bc -import-instr-limit=10 -S | FileCheck %s --check-prefix=CHECK --check-prefix=INSTLIM-DEFAULT 8*cee313d2SEric Christopher; INSTLIM-DEFAULT: call void @staticfunc2.llvm. 9*cee313d2SEric Christopher 10*cee313d2SEric Christopher; Test import with a reduced progressive instruction factor 11*cee313d2SEric Christopher; RUN: opt -function-import -summary-file %t3.thinlto.bc %t.bc -import-instr-limit=10 -import-instr-evolution-factor=0.5 -S | FileCheck %s --check-prefix=CHECK --check-prefix=INSTLIM-PROGRESSIVE 12*cee313d2SEric Christopher; INSTLIM-PROGRESSIVE-NOT: call void @staticfunc 13*cee313d2SEric Christopher 14*cee313d2SEric Christopher 15*cee313d2SEric Christopher 16*cee313d2SEric Christopherdeclare void @globalfunc1() 17*cee313d2SEric Christopherdeclare void @globalfunc2() 18*cee313d2SEric Christopher 19*cee313d2SEric Christopherdefine void @entry() { 20*cee313d2SEric Christopherentry: 21*cee313d2SEric Christopher; Call site are processed in reversed order! 22*cee313d2SEric Christopher 23*cee313d2SEric Christopher; On the direct call, we reconsider @largefunction with a higher threshold and 24*cee313d2SEric Christopher; import it 25*cee313d2SEric Christopher call void @globalfunc2() 26*cee313d2SEric Christopher; When importing globalfunc1, the threshold was limited and @largefunction was 27*cee313d2SEric Christopher; not imported. 28*cee313d2SEric Christopher call void @globalfunc1() 29*cee313d2SEric Christopher ret void 30*cee313d2SEric Christopher} 31*cee313d2SEric Christopher 32