diff options
| author | Peter Collingbourne <peter@pcc.me.uk> | 2017-04-17 17:51:36 +0000 |
|---|---|---|
| committer | Peter Collingbourne <peter@pcc.me.uk> | 2017-04-17 17:51:36 +0000 |
| commit | a0f371a106f003bb6575bc8f19ab82121d8bc1c4 (patch) | |
| tree | 7367ce107322299d35983d4e5a7fd4c98dff7709 /llvm/test/Bitcode/thinlto-function-summary-refgraph.ll | |
| parent | dc77b2e960b6b6d4622c89ee8d324848ac6a0609 (diff) | |
| download | llvm-a0f371a106f003bb6575bc8f19ab82121d8bc1c4.zip llvm-a0f371a106f003bb6575bc8f19ab82121d8bc1c4.tar.gz llvm-a0f371a106f003bb6575bc8f19ab82121d8bc1c4.tar.bz2 | |
Bitcode: Add a string table to the bitcode format.
Add a top-level STRTAB block containing a string table blob, and start storing
strings for module codes FUNCTION, GLOBALVAR, ALIAS, IFUNC and COMDAT in
the string table.
This change allows us to share names between globals and comdats as well
as between modules, and improves the efficiency of loading bitcode files by
no longer using a bit encoding for symbol names. Once we start writing the
irsymtab to the bitcode file we will also be able to share strings between
it and the module.
On my machine, link time for Chromium for Linux with ThinLTO decreases by
about 7% for no-op incremental builds or about 1% for full builds. Total
bitcode file size decreases by about 3%.
As discussed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2017-April/111732.html
Differential Revision: https://reviews.llvm.org/D31838
llvm-svn: 300464
Diffstat (limited to 'llvm/test/Bitcode/thinlto-function-summary-refgraph.ll')
| -rw-r--r-- | llvm/test/Bitcode/thinlto-function-summary-refgraph.ll | 59 |
1 files changed, 40 insertions, 19 deletions
diff --git a/llvm/test/Bitcode/thinlto-function-summary-refgraph.ll b/llvm/test/Bitcode/thinlto-function-summary-refgraph.ll index 882f865..b52fce7 100644 --- a/llvm/test/Bitcode/thinlto-function-summary-refgraph.ll +++ b/llvm/test/Bitcode/thinlto-function-summary-refgraph.ll @@ -2,6 +2,32 @@ ; RUN: opt -module-summary %s -o %t.o ; RUN: llvm-bcanalyzer -dump %t.o | FileCheck %s +; CHECK: <SOURCE_FILENAME +; "bar" +; CHECK-NEXT: <GLOBALVAR {{.*}} op0=0 op1=3 +; "globalvar" +; CHECK-NEXT: <GLOBALVAR {{.*}} op0=3 op1=9 +; "func" +; CHECK-NEXT: <FUNCTION op0=12 op1=4 +; "func2" +; CHECK-NEXT: <FUNCTION op0=16 op1=5 +; "foo" +; CHECK-NEXT: <FUNCTION op0=21 op1=3 +; "func3" +; CHECK-NEXT: <FUNCTION op0=24 op1=5 +; "W" +; CHECK-NEXT: <FUNCTION op0=29 op1=1 +; "X" +; CHECK-NEXT: <FUNCTION op0=30 op1=1 +; "Y" +; CHECK-NEXT: <FUNCTION op0=31 op1=1 +; "Z" +; CHECK-NEXT: <FUNCTION op0=32 op1=1 +; "llvm.ctpop.i8" +; CHECK-NEXT: <FUNCTION op0=33 op1=13 +; "main" +; CHECK-NEXT: <FUNCTION op0=46 op1=4 + ; See if the calls and other references are recorded properly using the ; expected value id and other information as appropriate (callsite cout ; for calls). Use different linkage types for the various test cases to @@ -11,37 +37,32 @@ ; llvm.ctpop.i8. ; CHECK: <GLOBALVAL_SUMMARY_BLOCK ; Function main contains call to func, as well as address reference to func: -; CHECK-DAG: <PERMODULE {{.*}} op0=[[MAINID:[0-9]+]] op1=0 {{.*}} op3=1 op4=[[FUNCID:[0-9]+]] op5=[[FUNCID]]/> +; op0=main op4=func op5=func +; CHECK-DAG: <PERMODULE {{.*}} op0=11 op1=0 {{.*}} op3=1 op4=2 op5=2/> ; Function W contains a call to func3 as well as a reference to globalvar: -; CHECK-DAG: <PERMODULE {{.*}} op0=[[WID:[0-9]+]] op1=5 {{.*}} op3=1 op4=[[GLOBALVARID:[0-9]+]] op5=[[FUNC3ID:[0-9]+]]/> +; op0=W op4=globalvar op5=func3 +; CHECK-DAG: <PERMODULE {{.*}} op0=6 op1=5 {{.*}} op3=1 op4=1 op5=5/> ; Function X contains call to foo, as well as address reference to foo ; which is in the same instruction as the call: -; CHECK-DAG: <PERMODULE {{.*}} op0=[[XID:[0-9]+]] op1=1 {{.*}} op3=1 op4=[[FOOID:[0-9]+]] op5=[[FOOID]]/> +; op0=X op4=foo op5=foo +; CHECK-DAG: <PERMODULE {{.*}} op0=7 op1=1 {{.*}} op3=1 op4=4 op5=4/> ; Function Y contains call to func2, and ensures we don't incorrectly add ; a reference to it when reached while earlier analyzing the phi using its ; return value: -; CHECK-DAG: <PERMODULE {{.*}} op0=[[YID:[0-9]+]] op1=8 {{.*}} op3=0 op4=[[FUNC2ID:[0-9]+]]/> +; op0=Y op4=func2 +; CHECK-DAG: <PERMODULE {{.*}} op0=8 op1=8 {{.*}} op3=0 op4=3/> ; Function Z contains call to func2, and ensures we don't incorrectly add ; a reference to it when reached while analyzing subsequent use of its return ; value: -; CHECK-DAG: <PERMODULE {{.*}} op0=[[ZID:[0-9]+]] op1=3 {{.*}} op3=0 op4=[[FUNC2ID:[0-9]+]]/> +; op0=Z op4=func2 +; CHECK-DAG: <PERMODULE {{.*}} op0=9 op1=3 {{.*}} op3=0 op4=3/> ; Variable bar initialization contains address reference to func: -; CHECK-DAG: <PERMODULE_GLOBALVAR_INIT_REFS {{.*}} op0=[[BARID:[0-9]+]] op1=0 op2=[[FUNCID]]/> +; op0=bar op2=func +; CHECK-DAG: <PERMODULE_GLOBALVAR_INIT_REFS {{.*}} op0=0 op1=0 op2=2/> ; CHECK: </GLOBALVAL_SUMMARY_BLOCK> -; CHECK-NEXT: <VALUE_SYMTAB -; CHECK-DAG: <ENTRY {{.*}} op0=[[BARID]] {{.*}} record string = 'bar' -; CHECK-DAG: <ENTRY {{.*}} op0=[[FUNCID]] {{.*}} record string = 'func' -; CHECK-DAG: <ENTRY {{.*}} op0=[[FOOID]] {{.*}} record string = 'foo' -; CHECK-DAG: <FNENTRY {{.*}} op0=[[MAINID]] {{.*}} record string = 'main' -; CHECK-DAG: <FNENTRY {{.*}} op0=[[WID]] {{.*}} record string = 'W' -; CHECK-DAG: <FNENTRY {{.*}} op0=[[XID]] {{.*}} record string = 'X' -; CHECK-DAG: <FNENTRY {{.*}} op0=[[YID]] {{.*}} record string = 'Y' -; CHECK-DAG: <FNENTRY {{.*}} op0=[[ZID]] {{.*}} record string = 'Z' -; CHECK-DAG: <ENTRY {{.*}} op0=[[FUNC2ID]] {{.*}} record string = 'func2' -; CHECK-DAG: <ENTRY {{.*}} op0=[[FUNC3ID]] {{.*}} record string = 'func3' -; CHECK-DAG: <ENTRY {{.*}} op0=[[GLOBALVARID]] {{.*}} record string = 'globalvar' -; CHECK: </VALUE_SYMTAB> +; CHECK: <STRTAB_BLOCK +; CHECK-NEXT: blob data = 'barglobalvarfuncfunc2foofunc3WXYZllvm.ctpop.i8main' ; ModuleID = 'thinlto-function-summary-refgraph.ll' target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" |
