diff options
author | Easwaran Raman <eraman@google.com> | 2018-12-13 19:54:27 +0000 |
---|---|---|
committer | Easwaran Raman <eraman@google.com> | 2018-12-13 19:54:27 +0000 |
commit | 5a7056fa039d3fd5e241d7db8e44c063214ec4ca (patch) | |
tree | 8a046de580555ba4a5cc4b3d0cb03c7e874dfffb /llvm/test/Bitcode | |
parent | 41c729e78ec61f47c9b44978a58b23120347d18f (diff) | |
download | bcm5719-llvm-5a7056fa039d3fd5e241d7db8e44c063214ec4ca.tar.gz bcm5719-llvm-5a7056fa039d3fd5e241d7db8e44c063214ec4ca.zip |
[ThinLTO] Compute synthetic function entry count
Summary:
This patch computes the synthetic function entry count on the whole
program callgraph (based on module summary) and writes the entry counts
to the summary. After function importing, this count gets attached to
the IR as metadata. Since it adds a new field to the summary, this bumps
up the version.
Reviewers: tejohnson
Subscribers: mehdi_amini, inglorion, llvm-commits
Differential Revision: https://reviews.llvm.org/D43521
llvm-svn: 349076
Diffstat (limited to 'llvm/test/Bitcode')
7 files changed, 27 insertions, 6 deletions
diff --git a/llvm/test/Bitcode/summary_version.ll b/llvm/test/Bitcode/summary_version.ll index 4913a1ec066..fc3b3bd4877 100644 --- a/llvm/test/Bitcode/summary_version.ll +++ b/llvm/test/Bitcode/summary_version.ll @@ -2,7 +2,7 @@ ; RUN: opt -module-summary %s -o - | llvm-bcanalyzer -dump | FileCheck %s ; CHECK: <GLOBALVAL_SUMMARY_BLOCK -; CHECK: <VERSION op0=5/> +; CHECK: <VERSION op0=6/> diff --git a/llvm/test/Bitcode/thinlto-alias.ll b/llvm/test/Bitcode/thinlto-alias.ll index 6369a6c7e7f..835d720c69e 100644 --- a/llvm/test/Bitcode/thinlto-alias.ll +++ b/llvm/test/Bitcode/thinlto-alias.ll @@ -33,7 +33,7 @@ ; COMBINED-NEXT: <VALUE_GUID op0=[[ALIASID:[0-9]+]] op1=-5751648690987223394/> ; COMBINED-NEXT: <VALUE_GUID ; COMBINED-NEXT: <VALUE_GUID op0=[[ALIASEEID:[0-9]+]] op1=-1039159065113703048/> -; COMBINED-NEXT: <COMBINED {{.*}} op7=[[ALIASID]]/> +; COMBINED-NEXT: <COMBINED {{.*}} op8=[[ALIASID]]/> ; COMBINED-NEXT: <COMBINED {{.*}} ; COMBINED-NEXT: <COMBINED_ALIAS {{.*}} op3=[[ALIASEEID]] ; COMBINED-NEXT: </GLOBALVAL_SUMMARY_BLOCK diff --git a/llvm/test/Bitcode/thinlto-function-summary-callgraph-pgo.ll b/llvm/test/Bitcode/thinlto-function-summary-callgraph-pgo.ll index d7cf4d7deb2..e332224343e 100644 --- a/llvm/test/Bitcode/thinlto-function-summary-callgraph-pgo.ll +++ b/llvm/test/Bitcode/thinlto-function-summary-callgraph-pgo.ll @@ -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 {{.*}} op7=[[FUNCID]] op8=2/> +; COMBINED-NEXT: <COMBINED_PROFILE {{.*}} op8=[[FUNCID]] op9=2/> ; COMBINED-NEXT: </GLOBALVAL_SUMMARY_BLOCK> ; ModuleID = 'thinlto-function-summary-callgraph.ll' diff --git a/llvm/test/Bitcode/thinlto-function-summary-callgraph-profile-summary.ll b/llvm/test/Bitcode/thinlto-function-summary-callgraph-profile-summary.ll index f749489629c..31c99c189ac 100644 --- a/llvm/test/Bitcode/thinlto-function-summary-callgraph-profile-summary.ll +++ b/llvm/test/Bitcode/thinlto-function-summary-callgraph-profile-summary.ll @@ -71,7 +71,7 @@ ; COMBINED-NEXT: <COMBINED abbrevid= ; COMBINED-NEXT: <COMBINED abbrevid= ; COMBINED-NEXT: <COMBINED abbrevid= -; COMBINED-NEXT: <COMBINED_PROFILE {{.*}} op7=[[HOT1:.*]] op8=3 op9=[[COLD:.*]] op10=1 op11=[[HOT2:.*]] op12=3 op13=[[NONE1:.*]] op14=2 op15=[[HOT3:.*]] op16=3 op17=[[NONE2:.*]] op18=2 op19=[[NONE3:.*]] op20=2/> +; COMBINED-NEXT: <COMBINED_PROFILE {{.*}} op8=[[HOT1:.*]] op9=3 op10=[[COLD:.*]] op11=1 op12=[[HOT2:.*]] op13=3 op14=[[NONE1:.*]] op15=2 op16=[[HOT3:.*]] op17=3 op18=[[NONE2:.*]] op19=2 op20=[[NONE3:.*]] op21=2/> ; COMBINED_NEXT: <COMBINED abbrevid= ; COMBINED_NEXT: </GLOBALVAL_SUMMARY_BLOCK> diff --git a/llvm/test/Bitcode/thinlto-function-summary-callgraph-sample-profile-summary.ll b/llvm/test/Bitcode/thinlto-function-summary-callgraph-sample-profile-summary.ll index e70ca706f42..d1f980ab5f6 100644 --- a/llvm/test/Bitcode/thinlto-function-summary-callgraph-sample-profile-summary.ll +++ b/llvm/test/Bitcode/thinlto-function-summary-callgraph-sample-profile-summary.ll @@ -58,7 +58,7 @@ ; COMBINED-NEXT: <COMBINED abbrevid= ; COMBINED-NEXT: <COMBINED abbrevid= ; COMBINED-NEXT: <COMBINED abbrevid= -; COMBINED-NEXT: <COMBINED_PROFILE {{.*}} op7=[[NONE1:.*]] op8=0 op9=[[HOT1:.*]] op10=3 op11=[[COLD1:.*]] op12=1 op13=[[NONE2:.*]] op14=0 op15=[[HOT2:.*]] op16=3 op17=[[COLD2:.*]] op18=1 op19=[[NONE3:.*]] op20=0 op21=[[HOT3:.*]] op22=3 op23=[[COLD3:.*]] op24=1/> +; COMBINED-NEXT: <COMBINED_PROFILE {{.*}} op8=[[NONE1:.*]] op9=0 op10=[[HOT1:.*]] op11=3 op12=[[COLD1:.*]] op13=1 op14=[[NONE2:.*]] op15=0 op16=[[HOT2:.*]] op17=3 op18=[[COLD2:.*]] op19=1 op20=[[NONE3:.*]] op21=0 op22=[[HOT3:.*]] op23=3 op24=[[COLD3:.*]] op25=1/> ; COMBINED_NEXT: <COMBINED abbrevid= ; COMBINED_NEXT: </GLOBALVAL_SUMMARY_BLOCK> diff --git a/llvm/test/Bitcode/thinlto-function-summary-callgraph.ll b/llvm/test/Bitcode/thinlto-function-summary-callgraph.ll index ca6ed433f7b..a605b7ec221 100644 --- a/llvm/test/Bitcode/thinlto-function-summary-callgraph.ll +++ b/llvm/test/Bitcode/thinlto-function-summary-callgraph.ll @@ -33,7 +33,7 @@ ; COMBINED-NEXT: <VALUE_GUID ; COMBINED-NEXT: <COMBINED ; See if the call to func is registered. -; COMBINED-NEXT: <COMBINED {{.*}} op7=[[FUNCID]]/> +; COMBINED-NEXT: <COMBINED {{.*}} op8=[[FUNCID]]/> ; COMBINED-NEXT: </GLOBALVAL_SUMMARY_BLOCK> ; ModuleID = 'thinlto-function-summary-callgraph.ll' diff --git a/llvm/test/Bitcode/thinlto-synthetic-count-flag.ll b/llvm/test/Bitcode/thinlto-synthetic-count-flag.ll new file mode 100644 index 00000000000..eb18a025b94 --- /dev/null +++ b/llvm/test/Bitcode/thinlto-synthetic-count-flag.ll @@ -0,0 +1,21 @@ +; REQUIRES: x86-registered-target +; RUN: opt -module-summary %s -o %t.o + +; Ensure synthetic entry count flag is not set on distributed index +; RUN: llvm-lto2 run %t.o -o %t.out -thinlto-distributed-indexes \ +; RUN: -r %t.o,glob,plx -compute-dead=false +; RUN: llvm-bcanalyzer -dump %t.o.thinlto.bc | FileCheck %s --check-prefix=NOSYNTHETIC +; NOSYNTHETIC: <FLAGS op0=0/> + +; Ensure synthetic entry count flag is set on distributed index +; when option used to enable synthetic count propagation +; RUN: llvm-lto2 run %t.o -o %t.out -thinlto-distributed-indexes \ +; RUN: -r %t.o,glob,plx -thinlto-synthesize-entry-counts \ +; RUN: -compute-dead=false +; RUN: llvm-bcanalyzer -dump %t.o.thinlto.bc | FileCheck %s --check-prefix=HASSYNTHETIC +; HASSYNTHETIC: <FLAGS op0=4/> + +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@glob = global i32 0 |