diff options
Diffstat (limited to 'test/Transforms/FunctionImport/Inputs')
4 files changed, 97 insertions, 3 deletions
diff --git a/test/Transforms/FunctionImport/Inputs/adjustable_threshold.ll b/test/Transforms/FunctionImport/Inputs/adjustable_threshold.ll new file mode 100644 index 0000000000000..fd4644d264a5e --- /dev/null +++ b/test/Transforms/FunctionImport/Inputs/adjustable_threshold.ll @@ -0,0 +1,37 @@ +define void @globalfunc1() { +entry: + call void @trampoline() + ret void +} +; Adds an artificial level in the call graph to reduce the importing threshold +define void @trampoline() { +entry: + call void @largefunction() + ret void +} + +define void @globalfunc2() { +entry: + call void @largefunction() + ret void +} + + +; Size is 5: if two layers below in the call graph the threshold will be 4, +; but if only one layer below the threshold will be 7. +define void @largefunction() { + entry: + call void @staticfunc2() + call void @staticfunc2() + call void @staticfunc2() + call void @staticfunc2() + call void @staticfunc2() + ret void +} + +define internal void @staticfunc2() { +entry: + ret void +} + + diff --git a/test/Transforms/FunctionImport/Inputs/funcimport.ll b/test/Transforms/FunctionImport/Inputs/funcimport.ll index 79b766b386df3..fa96b8ea2663f 100644 --- a/test/Transforms/FunctionImport/Inputs/funcimport.ll +++ b/test/Transforms/FunctionImport/Inputs/funcimport.ll @@ -75,6 +75,11 @@ entry: ret void } +define linkonce void @linkoncefunc2() #0 { +entry: + ret void +} + define internal i32 @staticfunc() #0 { entry: ret i32 1 @@ -99,4 +104,46 @@ entry: ret void } +define void @referencelargelinkonce() #0 { +entry: + call void @linkonceodr() + ret void +} + +; A large enough linkonce_odr function that should never be imported +define linkonce_odr void @linkonceodr() #0 { +entry: + call void @globalfunc2() + call void @globalfunc2() + call void @globalfunc2() + call void @globalfunc2() + call void @globalfunc2() + call void @globalfunc2() + call void @globalfunc2() + call void @globalfunc2() + call void @globalfunc2() + call void @globalfunc2() + call void @globalfunc2() + call void @globalfunc2() + call void @globalfunc2() + call void @globalfunc2() + call void @globalfunc2() + call void @globalfunc2() + call void @globalfunc2() + call void @globalfunc2() + call void @globalfunc2() + call void @globalfunc2() + call void @globalfunc2() + call void @globalfunc2() + call void @globalfunc2() + call void @globalfunc2() + call void @globalfunc2() + call void @globalfunc2() + call void @globalfunc2() + call void @globalfunc2() + call void @globalfunc2() + call void @globalfunc2() + ret void +} + diff --git a/test/Transforms/FunctionImport/Inputs/funcimport_debug.ll b/test/Transforms/FunctionImport/Inputs/funcimport_debug.ll index 35c62a2629033..0e75924cd3b63 100644 --- a/test/Transforms/FunctionImport/Inputs/funcimport_debug.ll +++ b/test/Transforms/FunctionImport/Inputs/funcimport_debug.ll @@ -14,11 +14,10 @@ attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fp !llvm.module.flags = !{!7, !8} !llvm.ident = !{!9} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (trunk 255685) (llvm/trunk 255682)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (trunk 255685) (llvm/trunk 255682)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) !1 = !DIFile(filename: "funcimport_debug.c", directory: ".") !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "func", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, variables: !2) +!4 = distinct !DISubprogram(name: "func", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, unit: !0, variables: !2) !5 = !DISubroutineType(types: !6) !6 = !{null} !7 = !{i32 2, !"Dwarf Version", i32 4} diff --git a/test/Transforms/FunctionImport/Inputs/inlineasm.ll b/test/Transforms/FunctionImport/Inputs/inlineasm.ll new file mode 100644 index 0000000000000..1ffc5db5f8b0d --- /dev/null +++ b/test/Transforms/FunctionImport/Inputs/inlineasm.ll @@ -0,0 +1,11 @@ +@myvar = internal constant i8 1, align 1 +@llvm.used = appending global [1 x i8*] [i8* @myvar], section "llvm.metadata" + +define void @foo(i64* %v) #0 { +entry: + %v.addr = alloca i64*, align 8 + store i64* %v, i64** %v.addr, align 8 + %0 = load i64*, i64** %v.addr, align 8 + call void asm sideeffect "movzbl myvar(%rip), %eax\0A\09movq %rax, $0\0A\09", "=*m,~{eax},~{dirflag},~{fpsr},~{flags}"(i64* %0) #1 + ret void +} |