diff options
author | Teresa Johnson <tejohnson@google.com> | 2017-05-31 18:58:11 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2017-05-31 18:58:11 +0000 |
commit | a01adefb51f073c3b038a309c96eafd49ac414fe (patch) | |
tree | ba9537171b9dd0d371ba8450209dc1f577c7e511 /test/Bitcode | |
parent | 35f98ce71528047354e65be48e9030d2098f0247 (diff) |
[ThinLTO] Reduce unnecessary map lookups during combined summary write
Summary:
Don't assign values to undefined references, simply don't emit those
reference edges as they are not useful (we were already not emitting
call edges to undefined refs).
Also, streamline the later lookup of value ids when writing the
summaries, by combining the check for value id existence with the access
of that value id.
Reviewers: pcc
Subscribers: Prazek, llvm-commits, inglorion
Differential Revision: https://reviews.llvm.org/D33634
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304323 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Bitcode')
-rw-r--r-- | test/Bitcode/thinlto-function-summary-callgraph.ll | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/test/Bitcode/thinlto-function-summary-callgraph.ll b/test/Bitcode/thinlto-function-summary-callgraph.ll index 8cc60ad6336..566f3a077e7 100644 --- a/test/Bitcode/thinlto-function-summary-callgraph.ll +++ b/test/Bitcode/thinlto-function-summary-callgraph.ll @@ -11,20 +11,23 @@ ; RUN: llvm-lto -thinlto-index-stats %p/Inputs/thinlto-function-summary-callgraph-combined.1.bc | FileCheck %s --check-prefix=OLD-COMBINED ; CHECK: <SOURCE_FILENAME +; CHECK-NEXT: <GLOBALVAR ; CHECK-NEXT: <FUNCTION ; "func" -; CHECK-NEXT: <FUNCTION op0=4 op1=4 +; CHECK-NEXT: <FUNCTION op0=17 op1=4 ; CHECK: <GLOBALVAL_SUMMARY_BLOCK ; CHECK-NEXT: <VERSION ; See if the call to func is registered. -; CHECK-NEXT: <PERMODULE {{.*}} op4=1/> +; CHECK-NEXT: <PERMODULE {{.*}} op3=1 ; CHECK-NEXT: </GLOBALVAL_SUMMARY_BLOCK> ; CHECK: <STRTAB_BLOCK -; CHECK-NEXT: blob data = 'mainfunc' +; CHECK-NEXT: blob data = 'undefinedglobmainfunc' ; COMBINED: <GLOBALVAL_SUMMARY_BLOCK ; COMBINED-NEXT: <VERSION +; Only 2 VALUE_GUID since reference to undefinedglob should not be included in +; combined index. ; COMBINED-NEXT: <VALUE_GUID op0=[[FUNCID:[0-9]+]] op1=7289175272376759421/> ; COMBINED-NEXT: <VALUE_GUID ; COMBINED-NEXT: <COMBINED @@ -40,10 +43,12 @@ target triple = "x86_64-unknown-linux-gnu" define i32 @main() #0 { entry: call void (...) @func() - ret i32 0 + %u = load i32, i32* @undefinedglob + ret i32 %u } declare void @func(...) #1 +@undefinedglob = external global i32 ; OLD: Index {{.*}} contains 1 nodes (1 functions, 0 alias, 0 globals) and 1 edges (0 refs and 1 calls) ; OLD-COMBINED: Index {{.*}} contains 2 nodes (2 functions, 0 alias, 0 globals) and 1 edges (0 refs and 1 calls) |