[ThinLTO] Internalize readonly globals

This patch allows internalising globals if all accesses to them
(from live functions) are from non-volatile load instructions

Differential revision: https://reviews.llvm.org/D49362


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346584 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eugene Leviant
2018-11-10 08:31:21 +00:00
parent 01568d51f0
commit 10c84a8f35
42 changed files with 774 additions and 89 deletions
@@ -17,7 +17,7 @@
; CHECK: <GLOBALVAL_SUMMARY_BLOCK
; CHECK-NEXT: <VERSION
; See if the call to func is registered, using the expected hotness type.
; CHECK-NEXT: <PERMODULE_PROFILE {{.*}} op5=1 op6=2/>
; CHECK-NEXT: <PERMODULE_PROFILE {{.*}} op6=1 op7=2/>
; CHECK-NEXT: </GLOBALVAL_SUMMARY_BLOCK>
; CHECK: <STRTAB_BLOCK
; CHECK-NEXT: blob data = 'mainfunc{{.*}}'
@@ -30,7 +30,7 @@
; COMBINED-NEXT: <COMBINED
; See if the call to func is registered, using the expected hotness type.
; op6=2 which is hotnessType::None.
; COMBINED-NEXT: <COMBINED_PROFILE {{.*}} op6=[[FUNCID]] op7=2/>
; COMBINED-NEXT: <COMBINED_PROFILE {{.*}} op7=[[FUNCID]] op8=2/>
; COMBINED-NEXT: </GLOBALVAL_SUMMARY_BLOCK>
; ModuleID = 'thinlto-function-summary-callgraph.ll'