diff options
author | Easwaran Raman <eraman@google.com> | 2018-01-24 17:51:23 +0000 |
---|---|---|
committer | Easwaran Raman <eraman@google.com> | 2018-01-24 17:51:23 +0000 |
commit | 5f7aff9a0a8b651348b024bd240fdb705d907f12 (patch) | |
tree | 005191f1c92997b6d3b9696ba348433f18d18ee6 /llvm/test/Bitcode | |
parent | 4bd8e5332fa5e697bec7ce2cc6642b9708e36e46 (diff) | |
download | bcm5719-llvm-5f7aff9a0a8b651348b024bd240fdb705d907f12.tar.gz bcm5719-llvm-5f7aff9a0a8b651348b024bd240fdb705d907f12.zip |
[ThinLTO] Add call edges' relative block frequency to per-module summary.
Summary:
This allows relative block frequency of call edges to be passed to the
thinlink stage where it will be used to compute synthetic entry counts
of functions.
Reviewers: tejohnson, pcc
Subscribers: mehdi_amini, llvm-commits, inglorion
Differential Revision: https://reviews.llvm.org/D42212
llvm-svn: 323349
Diffstat (limited to 'llvm/test/Bitcode')
-rw-r--r-- | llvm/test/Bitcode/thinlto-function-summary-callgraph-relbf.ll | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/llvm/test/Bitcode/thinlto-function-summary-callgraph-relbf.ll b/llvm/test/Bitcode/thinlto-function-summary-callgraph-relbf.ll new file mode 100644 index 00000000000..779acada520 --- /dev/null +++ b/llvm/test/Bitcode/thinlto-function-summary-callgraph-relbf.ll @@ -0,0 +1,35 @@ +; Test to check the callgraph in summary +; RUN: opt -write-relbf-to-summary -module-summary %s -o %t.o +; RUN: llvm-bcanalyzer -dump %t.o | FileCheck %s + + +; CHECK: <SOURCE_FILENAME +; CHECK-NEXT: <GLOBALVAR +; CHECK-NEXT: <FUNCTION +; "func" +; 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_RELBF {{.*}} op4=1 {{.*}} op7=1 +; CHECK-NEXT: </GLOBALVAL_SUMMARY_BLOCK> +; CHECK: <STRTAB_BLOCK +; CHECK-NEXT: blob data = 'undefinedglobmainfunc{{.*}}' + + +; ModuleID = 'thinlto-function-summary-callgraph.ll' +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +; Function Attrs: nounwind uwtable +define i32 @main() #0 { +entry: + call void (...) @func() + %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) |