2018-01-25 23:23:52 +01:00
|
|
|
; 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
|
2018-05-26 04:34:13 +02:00
|
|
|
; RUN: llvm-dis -o - %t.o | FileCheck %s --check-prefix=DIS
|
2018-06-26 15:56:49 +02:00
|
|
|
; Round trip it through llvm-as
|
|
|
|
; RUN: llvm-dis -o - %t.o | llvm-as -write-relbf-to-summary -o - | llvm-dis -o - | FileCheck %s --check-prefix=DIS
|
2018-01-25 23:23:52 +01:00
|
|
|
|
|
|
|
; CHECK: <SOURCE_FILENAME
|
|
|
|
; CHECK-NEXT: <GLOBALVAR
|
|
|
|
; CHECK-NEXT: <FUNCTION
|
|
|
|
; "func"
|
|
|
|
; CHECK-NEXT: <FUNCTION op0=17 op1=4
|
|
|
|
; CHECK: <GLOBALVAL_SUMMARY_BLOCK
|
|
|
|
; CHECK-NEXT: <VERSION
|
[LTO] Record whether LTOUnit splitting is enabled in index
Summary:
Records in the module summary index whether the bitcode was compiled
with the option necessary to enable splitting the LTO unit
(e.g. -fsanitize=cfi, -fwhole-program-vtables, or -fsplit-lto-unit).
The information is passed down to the ModuleSummaryIndex builder via a
new module flag "EnableSplitLTOUnit", which is propagated onto a flag
on the summary index.
This is then used during the LTO link to check whether all linked
summaries were built with the same value of this flag. If not, an error
is issued when we detect a situation requiring whole program visibility
of the class hierarchy. This is the case when both of the following
conditions are met:
1) We are performing LowerTypeTests or Whole Program Devirtualization.
2) There are type tests or type checked loads in the code.
Note I have also changed the ThinLTOBitcodeWriter to also gate the
module splitting on the value of this flag.
Reviewers: pcc
Subscribers: ormris, mehdi_amini, Prazek, inglorion, eraman, steven_wu, dexonsmith, arphaman, dang, llvm-commits
Differential Revision: https://reviews.llvm.org/D53890
llvm-svn: 350948
2019-01-11 19:31:57 +01:00
|
|
|
; CHECK-NEXT: <FLAGS
|
2018-01-25 23:23:52 +01:00
|
|
|
; See if the call to func is registered.
|
2019-07-05 17:25:05 +02:00
|
|
|
; CHECK-NEXT: <PERMODULE_RELBF {{.*}} op4=1 {{.*}} op9=256
|
2020-05-21 22:28:24 +02:00
|
|
|
; CHECK-NEXT: <BLOCK_COUNT op0=1/>
|
2018-01-25 23:23:52 +01:00
|
|
|
; 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)
|
2018-05-26 04:34:13 +02:00
|
|
|
|
2018-06-26 15:56:49 +02:00
|
|
|
; DIS: ^0 = module: (path: "{{.*}}", hash: (0, 0, 0, 0, 0))
|
2018-05-26 04:34:13 +02:00
|
|
|
; DIS: ^1 = gv: (name: "func") ; guid = 7289175272376759421
|
2021-01-27 19:43:51 +01:00
|
|
|
; DIS: ^2 = gv: (name: "main", summaries: (function: (module: ^0, flags: (linkage: external, visibility: default, notEligibleToImport: 0, live: 0, dsoLocal: 0, canAutoHide: 0), insts: 3, calls: ((callee: ^1, relbf: 256)), refs: (readonly ^3)))) ; guid = 15822663052811949562
|
2018-05-26 04:34:13 +02:00
|
|
|
; DIS: ^3 = gv: (name: "undefinedglob") ; guid = 18036901804029949403
|