summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2016-02-06 16:07:35 +0000
committerTeresa Johnson <tejohnson@google.com>2016-02-06 16:07:35 +0000
commit5e22e4461d23130484dfdc83d2646f1a92d8e74d (patch)
treec325e41e05c24cfba8d985fef7e09f3d143ce6bb /llvm/test
parent63b1ecab7ddc4d766263415c70f0794cedc2c11f (diff)
downloadbcm5719-llvm-5e22e4461d23130484dfdc83d2646f1a92d8e74d.tar.gz
bcm5719-llvm-5e22e4461d23130484dfdc83d2646f1a92d8e74d.zip
[ThinLTO] Include linkage type in function summary
Summary: Adds the linkage type to both the per-module and combined function summaries, which subsumes the current islocal bit. This will eventually be used to optimized linkage types based on global summary-based analysis. Reviewers: joker.eph Subscribers: joker.eph, davidxl, llvm-commits Differential Revision: http://reviews.llvm.org/D16943 llvm-svn: 259993
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Bitcode/thinlto-function-summary.ll4
-rw-r--r--llvm/test/Bitcode/thinlto-summary-linkage-types.ll61
2 files changed, 63 insertions, 2 deletions
diff --git a/llvm/test/Bitcode/thinlto-function-summary.ll b/llvm/test/Bitcode/thinlto-function-summary.ll
index d9531f7da89..e8d9b00d3eb 100644
--- a/llvm/test/Bitcode/thinlto-function-summary.ll
+++ b/llvm/test/Bitcode/thinlto-function-summary.ll
@@ -3,11 +3,11 @@
; Check the value ids in the function summary entries against the
; same in the ValueSumbolTable, to ensure the ordering is stable.
-; Also check the islocal flag on the summary entries.
+; Also check the linkage field on the summary entries.
; BC: <FUNCTION_SUMMARY_BLOCK
; BC-NEXT: <PERMODULE_ENTRY {{.*}} op0=1 op1=0
; BC-NEXT: <PERMODULE_ENTRY {{.*}} op0=2 op1=0
-; BC-NEXT: <PERMODULE_ENTRY {{.*}} op0=4 op1=1
+; BC-NEXT: <PERMODULE_ENTRY {{.*}} op0=4 op1=3
; BC-NEXT: </FUNCTION_SUMMARY_BLOCK
; BC-NEXT: <VALUE_SYMTAB
; BC-NEXT: <FNENTRY {{.*}} op0=1 {{.*}}> record string = 'foo'
diff --git a/llvm/test/Bitcode/thinlto-summary-linkage-types.ll b/llvm/test/Bitcode/thinlto-summary-linkage-types.ll
new file mode 100644
index 00000000000..5b7391e238f
--- /dev/null
+++ b/llvm/test/Bitcode/thinlto-summary-linkage-types.ll
@@ -0,0 +1,61 @@
+; Check the linkage types in both the per-module and combined summaries.
+; RUN: llvm-as -function-summary %s -o %t.o
+; RUN: llvm-bcanalyzer -dump %t.o | FileCheck %s
+; RUN: llvm-lto -thinlto -o %t2 %t.o
+; RUN: llvm-bcanalyzer -dump %t2.thinlto.bc | FileCheck %s --check-prefix=COMBINED
+
+define private void @private()
+; CHECK: <PERMODULE_ENTRY {{.*}} op1=9
+; COMBINED-DAG: <COMBINED_ENTRY {{.*}} op1=9
+{
+ ret void
+}
+
+define internal void @internal()
+; CHECK: <PERMODULE_ENTRY {{.*}} op1=3
+; COMBINED-DAG: <COMBINED_ENTRY {{.*}} op1=3
+{
+ ret void
+}
+
+define available_externally void @available_externally()
+; CHECK: <PERMODULE_ENTRY {{.*}} op1=12
+; COMBINED-DAG: <COMBINED_ENTRY {{.*}} op1=12
+{
+ ret void
+}
+
+define linkonce void @linkonce()
+; CHECK: <PERMODULE_ENTRY {{.*}} op1=18
+; COMBINED-DAG: <COMBINED_ENTRY {{.*}} op1=18
+{
+ ret void
+}
+
+define weak void @weak()
+; CHECK: <PERMODULE_ENTRY {{.*}} op1=16
+; COMBINED-DAG: <COMBINED_ENTRY {{.*}} op1=16
+{
+ ret void
+}
+
+define linkonce_odr void @linkonce_odr()
+; CHECK: <PERMODULE_ENTRY {{.*}} op1=19
+; COMBINED-DAG: <COMBINED_ENTRY {{.*}} op1=19
+{
+ ret void
+}
+
+define weak_odr void @weak_odr()
+; CHECK: <PERMODULE_ENTRY {{.*}} op1=17
+; COMBINED-DAG: <COMBINED_ENTRY {{.*}} op1=17
+{
+ ret void
+}
+
+define external void @external()
+; CHECK: <PERMODULE_ENTRY {{.*}} op1=0
+; COMBINED-DAG: <COMBINED_ENTRY {{.*}} op1=0
+{
+ ret void
+}
OpenPOWER on IntegriCloud