20
20
; RUN: -stats -debug -save-temps \
21
21
; RUN: -o %t.out 2>&1 | FileCheck %s --check-prefix=STATS --check-prefix=DEBUG
22
22
23
- ; RUN: llvm-dis %t.out.1.4.opt.bc -o - | FileCheck %s --check-prefix=IR
23
+ ;; We should not see any type of cold attribute or cloning applied
24
+ ; RUN: llvm-dis %t.out.1.4.opt.bc -o - | FileCheck %s --implicit-check-not cold \
25
+ ; RUN: --implicit-check-not ".memprof."
24
26
25
27
;; Try again but with distributed ThinLTO
26
28
; RUN: llvm-lto2 run %t.o -enable-memprof-context-disambiguation \
39
41
; RUN: -o %t2.out 2>&1 | FileCheck %s --check-prefix=STATS --check-prefix=DEBUG
40
42
41
43
;; Run ThinLTO backend
44
+ ;; We should not see any type of cold attribute or cloning applied
42
45
; RUN: opt -passes=memprof-context-disambiguation \
43
46
; RUN: -memprof-import-summary=%t.o.thinlto.bc \
44
- ; RUN: -stats %t.o -S 2>&1 | FileCheck %s --check-prefix=IR
47
+ ; RUN: -stats %t.o -S 2>&1 | FileCheck %s --implicit-check-not cold \
48
+ ; RUN: --implicit-check-not ".memprof."
45
49
46
50
; DEBUG: Not found through unique tail call chain: 17377440600225628772 (_Z3barv) from 15822663052811949562 (main) that actually called 8716735811002003409 (xyz) (found multiple possible chains)
47
51
48
52
; STATS: 1 memprof-context-disambiguation - Number of profiled callees found via multiple tail call chains
49
53
50
- ;; Check that all calls in the IR are to the original functions, leading to a
51
- ;; non-cold operator new call.
52
-
53
54
source_filename = "tailcall-nonunique.cc"
54
55
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
55
56
target triple = "x86_64-unknown-linux-gnu"
56
57
57
58
; Function Attrs: noinline
58
- ; IR-LABEL: @_Z3barv()
59
59
define dso_local ptr @_Z3barv () local_unnamed_addr #0 {
60
60
entry:
61
- ; IR: call {{.*}} @_Znam(i64 10) #[[NOTCOLD:[0-9]+]]
62
61
%call = tail call ptr @_Znam (i64 10 ) #2 , !memprof !0 , !callsite !9
63
62
ret ptr %call
64
63
}
@@ -67,54 +66,43 @@ entry:
67
66
declare ptr @_Znam (i64 ) #1
68
67
69
68
; Function Attrs: noinline
70
- ; IR-LABEL: @_Z5blah1v()
71
69
define dso_local ptr @_Z5blah1v () local_unnamed_addr #0 {
72
70
entry:
73
- ; IR: call ptr @_Z3barv()
74
71
%call = tail call ptr @_Z3barv ()
75
72
ret ptr %call
76
73
}
77
74
78
75
; Function Attrs: noinline
79
- ; IR-LABEL: @_Z5blah2v()
80
76
define dso_local ptr @_Z5blah2v () local_unnamed_addr #0 {
81
77
entry:
82
- ; IR: call ptr @_Z3barv()
83
78
%call = tail call ptr @_Z3barv ()
84
79
ret ptr %call
85
80
}
86
81
87
82
; Function Attrs: noinline
88
- ; IR-LABEL: @_Z4baz1v()
89
83
define dso_local ptr @_Z4baz1v () local_unnamed_addr #0 {
90
84
entry:
91
- ; IR: call ptr @_Z5blah1v()
92
85
%call = tail call ptr @_Z5blah1v ()
93
86
ret ptr %call
94
87
}
95
88
96
89
; Function Attrs: noinline
97
- ; IR-LABEL: @_Z4baz2v()
98
90
define dso_local ptr @_Z4baz2v () local_unnamed_addr #0 {
99
91
entry:
100
- ; IR: call ptr @_Z5blah2v()
101
92
%call = tail call ptr @_Z5blah2v ()
102
93
ret ptr %call
103
94
}
104
95
105
96
; Function Attrs: noinline
106
- ; IR-LABEL: @_Z3foob(i1 %b)
107
97
define dso_local ptr @_Z3foob (i1 %b ) local_unnamed_addr #0 {
108
98
entry:
109
99
br i1 %b , label %if.then , label %if.else
110
100
111
101
if.then: ; preds = %entry
112
- ; IR: call ptr @_Z4baz1v()
113
102
%call = tail call ptr @_Z4baz1v ()
114
103
br label %return
115
104
116
105
if.else: ; preds = %entry
117
- ; IR: call ptr @_Z4baz2v()
118
106
%call1 = tail call ptr @_Z4baz2v ()
119
107
br label %return
120
108
@@ -124,29 +112,21 @@ return: ; preds = %if.else, %if.then
124
112
}
125
113
126
114
; Function Attrs: noinline
127
- ; IR-LABEL: @xyz()
128
115
define dso_local i32 @xyz () local_unnamed_addr #0 {
129
116
delete.end13:
130
- ; IR: call ptr @_Z3foob(i1 true)
131
117
%call = tail call ptr @_Z3foob (i1 true )
132
- ; IR: call ptr @_Z3foob(i1 true)
133
118
%call1 = tail call ptr @_Z3foob (i1 true )
134
- ; IR: call ptr @_Z3foob(i1 false)
135
119
%call2 = tail call ptr @_Z3foob (i1 false )
136
- ; IR: call ptr @_Z3foob(i1 false)
137
120
%call3 = tail call ptr @_Z3foob (i1 false )
138
121
ret i32 0
139
122
}
140
123
141
124
define dso_local i32 @main () local_unnamed_addr #0 {
142
125
delete.end13:
143
- ; IR: call i32 @xyz()
144
126
%call1 = tail call i32 @xyz (), !callsite !11
145
127
ret i32 0
146
128
}
147
129
148
- ; IR: attributes #[[NOTCOLD]] = { builtin allocsize(0) "memprof"="notcold" }
149
-
150
130
attributes #0 = { noinline }
151
131
attributes #1 = { nobuiltin allocsize(0 ) }
152
132
attributes #2 = { builtin allocsize(0 ) }
0 commit comments