File: distributed_indexes.ll

package info (click to toggle)
llvm-toolchain-15 1%3A15.0.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,554,644 kB
  • sloc: cpp: 5,922,452; ansic: 1,012,136; asm: 674,362; python: 191,568; objc: 73,855; f90: 42,327; lisp: 31,913; pascal: 11,973; javascript: 10,144; sh: 9,421; perl: 7,447; ml: 5,527; awk: 3,523; makefile: 2,520; xml: 885; cs: 573; fortran: 567
file content (69 lines) | stat: -rw-r--r-- 2,863 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
; RUN: opt -module-summary %s -o %t1.bc
; RUN: opt -module-summary %p/Inputs/distributed_indexes.ll -o %t2.bc
; RUN: llvm-lto -thinlto-action=thinlink -o %t.index.bc %t1.bc %t2.bc
; RUN: llvm-lto -thinlto-action=distributedindexes -thinlto-index %t.index.bc %t1.bc %t2.bc
; RUN: llvm-bcanalyzer -dump %t1.bc.thinlto.bc | FileCheck %s --check-prefix=BACKEND1
; RUN: llvm-bcanalyzer -dump %t2.bc.thinlto.bc | FileCheck %s --check-prefix=BACKEND2

; The backend index for this module contains summaries from itself and
; Inputs/distributed_indexes.ll, as it imports from the latter.
; We should import @g and alias @analias. While we don't import the aliasee
; directly (and therefore don't have a third COMBINED record from module
; id 1), we will have a VALUE_GUID for it (hence the 4 VALUE_GUID entries).
; BACKEND1: <MODULE_STRTAB_BLOCK
; BACKEND1-NEXT: <ENTRY {{.*}} record string = '{{.*}}distributed_indexes.ll.tmp{{.*}}.bc'
; BACKEND1-NEXT: <ENTRY {{.*}} record string = '{{.*}}distributed_indexes.ll.tmp{{.*}}.bc'
; BACKEND1-NEXT: </MODULE_STRTAB_BLOCK
; BACKEND1-NEXT: <GLOBALVAL_SUMMARY_BLOCK
; BACKEND1-NEXT: <VERSION
; BACKEND1-DAG: <VALUE_GUID op0={{.*}}
; BACKEND1-DAG: <VALUE_GUID op0={{.*}}
; BACKEND1-DAG: <VALUE_GUID op0={{.*}}
; BACKEND1-DAG: <VALUE_GUID op0={{.*}}
; BACKEND1-DAG: <VALUE_GUID op0={{.*}}
; BACKEND1-NEXT: <COMBINED {{.*}} op1=0
; BACKEND1-NEXT: <COMBINED {{.*}} op1=0
; BACKEND1-NEXT: <COMBINED {{.*}} op1=1
; BACKEND1-NEXT: <COMBINED_ALIAS {{.*}} op1=1
; BACKEND1-NEXT: <BLOCK_COUNT op0=4/>
; BACKEND1-NEXT: </GLOBALVAL_SUMMARY_BLOCK

; The backend index for Input/distributed_indexes.ll contains summaries from
; itself only, as it does not import anything.
; BACKEND2: <MODULE_STRTAB_BLOCK
; BACKEND2-NEXT: <ENTRY {{.*}} record string = '{{.*}}distributed_indexes.ll.tmp2.bc'
; BACKEND2-NEXT: </MODULE_STRTAB_BLOCK
; BACKEND2-NEXT: <GLOBALVAL_SUMMARY_BLOCK
; BACKEND2-NEXT: <VERSION
; BACKEND2-DAG: <VALUE_GUID op0={{.*}}
; BACKEND2-DAG: <VALUE_GUID op0={{.*}}
; BACKEND2-DAG: <VALUE_GUID op0={{.*}}
; BACKEND2-NEXT: <COMBINED
; BACKEND2-NEXT: <COMBINED
; BACKEND2-NEXT: <COMBINED_ALIAS
; BACKEND2-NEXT: <BLOCK_COUNT op0=4/>
; BACKEND2-NEXT: </GLOBALVAL_SUMMARY_BLOCK

; Make sure that when the alias is imported as a copy of the aliasee, but the
; aliasee is not being imported by itself, that we can still print the summary.
; The aliasee should be "null".
; RUN: llvm-dis %t1.bc.thinlto.bc -o - | FileCheck %s --check-prefix=DIS
; DIS: aliasee: null

target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"

declare void @g(...)
declare void @analias(...)

define void @f() {
entry:
  call void (...) @g()
  call void (...) @analias()
  ret void
}

; Ensure we don't get a COMBINED_ORIGINAL_NAME record in the distributed index.
; The BACKEND1-NEXT checks would fail if we did.
define internal void @x() {
  ret void
}