summaryrefslogtreecommitdiff
path: root/test/Transforms/Internalize
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-10-25 21:29:52 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-10-25 21:29:52 +0000
commit0f978ea45945bf3b8f2ce20f46d78dc840894623 (patch)
treef4530b935c5be83b41b669610d72aab832e45115 /test/Transforms/Internalize
parent006183a9364660daba786d352df720e079412d60 (diff)
downloadllvm-0f978ea45945bf3b8f2ce20f46d78dc840894623.tar.gz
llvm-0f978ea45945bf3b8f2ce20f46d78dc840894623.tar.bz2
llvm-0f978ea45945bf3b8f2ce20f46d78dc840894623.tar.xz
Handle calls and invokes in GlobalStatus.
This patch teaches GlobalStatus to analyze a call that uses the global value as a callee, not as an argument. With this change internalize call handle the common use of linkonce_odr functions. This reduces the number of linkonce_odr functions in a LTO build of clang (checked with the emit-llvm gold plugin option) from 1730 to 60. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193436 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/Internalize')
-rw-r--r--test/Transforms/Internalize/linkonce_odr_func.ll37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/Transforms/Internalize/linkonce_odr_func.ll b/test/Transforms/Internalize/linkonce_odr_func.ll
new file mode 100644
index 0000000000..c82acc0174
--- /dev/null
+++ b/test/Transforms/Internalize/linkonce_odr_func.ll
@@ -0,0 +1,37 @@
+; RUN: opt < %s -internalize -internalize-dso-list foo1,foo2,foo3,foo4 -S | FileCheck %s
+
+; CHECK: define internal void @foo1(
+define linkonce_odr void @foo1() noinline {
+ ret void
+}
+
+; CHECK: define linkonce_odr void @foo2(
+define linkonce_odr void @foo2() noinline {
+ ret void
+}
+
+; CHECK: define internal void @foo3(
+define linkonce_odr void @foo3() noinline {
+ ret void
+}
+
+; CHECK: define linkonce_odr void @foo4(
+define linkonce_odr void @foo4() noinline {
+ ret void
+}
+
+declare void @f(void()*)
+
+define void @bar() {
+bb0:
+ call void @foo1()
+ call void @f(void()* @foo2)
+ invoke void @foo3() to label %bb1 unwind label %clean
+bb1:
+ invoke void @f(void()* @foo4) to label %bb2 unwind label %clean
+bb2:
+ ret void
+clean:
+ landingpad i32 personality i8* null cleanup
+ ret void
+}