summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/FunctionImport/funcimport.ll
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-05-03 00:27:28 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-05-03 00:27:28 +0000
commit5b85d8d67b28f082db53863a922895211a01baa2 (patch)
tree439413643e4744cf4ba7a2ba178e6de3bcff7242 /llvm/test/Transforms/FunctionImport/funcimport.ll
parentd1aabb28134a7e72ce4d6ac26b093648f5c57e88 (diff)
downloadbcm5719-llvm-5b85d8d67b28f082db53863a922895211a01baa2.tar.gz
bcm5719-llvm-5b85d8d67b28f082db53863a922895211a01baa2.zip
ThinLTO: do not import function whose linkage prevents inlining.
There is not point in importing a "weak" or a "linkonce" function since we won't be able to inline it anyway. We already had a targeted check for WeakAny, this is using the same check on GlobalValue as the inline, i.e. isMayBeOverriddenLinkage() From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 268341
Diffstat (limited to 'llvm/test/Transforms/FunctionImport/funcimport.ll')
-rw-r--r--llvm/test/Transforms/FunctionImport/funcimport.ll5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/test/Transforms/FunctionImport/funcimport.ll b/llvm/test/Transforms/FunctionImport/funcimport.ll
index f0df3200555..478613a2475 100644
--- a/llvm/test/Transforms/FunctionImport/funcimport.ll
+++ b/llvm/test/Transforms/FunctionImport/funcimport.ll
@@ -28,6 +28,7 @@ entry:
call void (...) @setfuncptr()
call void (...) @callfuncptr()
call void (...) @weakfunc()
+ call void (...) @linkoncefunc2()
call void (...) @referencelargelinkonce()
ret i32 0
}
@@ -94,6 +95,10 @@ declare void @referencelargelinkonce(...)
; CHECK-DAG: declare void @weakfunc(...)
declare void @weakfunc(...) #1
+; Won't import linkonce func
+; CHECK-DAG: declare void @linkoncefunc2(...)
+declare void @linkoncefunc2(...) #1
+
; INSTLIMDEF-DAG: Import funcwithpersonality
; INSTLIMDEF-DAG: define available_externally hidden void @funcwithpersonality.llvm.{{.*}}() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
; INSTLIM5-DAG: declare hidden void @funcwithpersonality.llvm.{{.*}}()
OpenPOWER on IntegriCloud