|
76 | 76 | ;; for each profiled target in the VP metadata. They will have the same stackIds
|
77 | 77 | ;; since the debug information for the callsite is the same.
|
78 | 78 | ; RUN: llvm-dis %t/foo.o -o - | FileCheck %s --check-prefix=CALLSITES
|
79 |
| -; CALLSITES: gv: (name: "_Z3fooR2B0j", {{.*}} callsites: ((callee: ^{{[0-9]+}}, clones: (0), stackIds: (16345663650247127235)), (callee: ^{{[0-9]+}}, clones: (0), stackIds: (16345663650247127235))) |
| 79 | +; CALLSITES: gv: (name: "_Z3fooR2B0j", {{.*}} callsites: ((callee: ^{{[0-9]+}}, clones: (0), stackIds: (16345663650247127235)), (callee: ^{{[0-9]+}}, clones: (0), stackIds: (16345663650247127235)) |
80 | 80 |
|
81 | 81 | ;; Make sure that we don't get the synthesized callsite records if the
|
82 | 82 | ;; -enable-memprof-indirect-call-support flag is false.
|
83 |
| -; RUN: opt -thinlto-bc %t/foo.ll -enable-memprof-indirect-call-support=false -o - \ |
84 |
| -; RUN: | llvm-dis -o - | FileCheck %s --implicit-check-not callsites |
| 83 | +; RUN: opt -thinlto-bc %t/foo.ll -enable-memprof-indirect-call-support=false >%t/foo.noicp.o |
| 84 | +; RUN: llvm-dis %t/foo.noicp.o -o - | FileCheck %s --implicit-check-not "stackIds: (16345663650247127235)" |
85 | 85 |
|
86 | 86 | ;; First perform in-process ThinLTO
|
87 | 87 | ; RUN: llvm-lto2 run %t/main.o %t/foo.o -enable-memprof-context-disambiguation \
|
88 | 88 | ; RUN: -supports-hot-cold-new \
|
89 | 89 | ; RUN: -r=%t/foo.o,_Z3fooR2B0j,plx \
|
| 90 | +; RUN: -r=%t/foo.o,_Z3xyzR2B0j, \ |
90 | 91 | ; RUN: -r=%t/main.o,_Z3fooR2B0j, \
|
91 | 92 | ; RUN: -r=%t/main.o,_Znwm, \
|
92 | 93 | ; RUN: -r=%t/main.o,_ZdlPvm, \
|
|
116 | 117 | ; RUN: -supports-hot-cold-new \
|
117 | 118 | ; RUN: -thinlto-distributed-indexes \
|
118 | 119 | ; RUN: -r=%t/foo.o,_Z3fooR2B0j,plx \
|
| 120 | +; RUN: -r=%t/foo.o,_Z3xyzR2B0j, \ |
119 | 121 | ; RUN: -r=%t/main.o,_Z3fooR2B0j, \
|
120 | 122 | ; RUN: -r=%t/main.o,_Znwm, \
|
121 | 123 | ; RUN: -r=%t/main.o,_ZdlPvm, \
|
|
141 | 143 | ; RUN: %t/foo.o -S 2>&1 | FileCheck %s --check-prefix=IR \
|
142 | 144 | ; RUN: --check-prefix=STATS-BE-DISTRIB --check-prefix=REMARKS-FOO
|
143 | 145 |
|
| 146 | +;; Retry with the ICP-disabled object file, and make sure we disable it again |
| 147 | +;; so we don't look for the synthesized callsite records when applying imports. |
| 148 | +;; We should not get any cloning. |
| 149 | +; RUN: llvm-lto2 run %t/main.o %t/foo.noicp.o -enable-memprof-context-disambiguation \ |
| 150 | +; RUN: -enable-memprof-indirect-call-support=false \ |
| 151 | +; RUN: -supports-hot-cold-new \ |
| 152 | +; RUN: -r=%t/foo.noicp.o,_Z3fooR2B0j,plx \ |
| 153 | +; RUN: -r=%t/foo.noicp.o,_Z3xyzR2B0j, \ |
| 154 | +; RUN: -r=%t/main.o,_Z3fooR2B0j, \ |
| 155 | +; RUN: -r=%t/main.o,_Znwm, \ |
| 156 | +; RUN: -r=%t/main.o,_ZdlPvm, \ |
| 157 | +; RUN: -r=%t/main.o,_Z8externalPi, \ |
| 158 | +; RUN: -r=%t/main.o,main,plx \ |
| 159 | +; RUN: -r=%t/main.o,_ZN2B03barEj,plx \ |
| 160 | +; RUN: -r=%t/main.o,_ZN1B3barEj,plx \ |
| 161 | +; RUN: -r=%t/main.o,_ZTV1B,plx \ |
| 162 | +; RUN: -r=%t/main.o,_ZTVN10__cxxabiv120__si_class_type_infoE,plx \ |
| 163 | +; RUN: -r=%t/main.o,_ZTS1B,plx \ |
| 164 | +; RUN: -r=%t/main.o,_ZTVN10__cxxabiv117__class_type_infoE,plx \ |
| 165 | +; RUN: -r=%t/main.o,_ZTS2B0,plx \ |
| 166 | +; RUN: -r=%t/main.o,_ZTI2B0,plx \ |
| 167 | +; RUN: -r=%t/main.o,_ZTI1B,plx \ |
| 168 | +; RUN: -r=%t/main.o,_ZTV2B0,plx \ |
| 169 | +; RUN: -thinlto-threads=1 \ |
| 170 | +; RUN: -memprof-verify-ccg -memprof-verify-nodes \ |
| 171 | +; RUN: -pass-remarks=. -save-temps \ |
| 172 | +; RUN: -o %t.noicp.out 2>&1 | FileCheck %s --implicit-check-not "created clone" |
| 173 | + |
| 174 | +; RUN: llvm-dis %t.noicp.out.2.4.opt.bc -o - | FileCheck %s --implicit-check-not "_Z3fooR2B0j.memprof" |
| 175 | + |
144 | 176 | ; REMARKS-MAIN: call in clone main assigned to call function clone _Z3fooR2B0j.memprof.1
|
145 | 177 | ; REMARKS-MAIN: call in clone main assigned to call function clone _Z3fooR2B0j.memprof.1
|
146 | 178 | ; REMARKS-MAIN: created clone _ZN2B03barEj.memprof.1
|
|
215 | 247 | 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"
|
216 | 248 | target triple = "x86_64-unknown-linux-gnu"
|
217 | 249 |
|
| 250 | +declare i32 @_Z3xyzR2B0j(ptr %b) |
| 251 | + |
218 | 252 | define i32 @_Z3fooR2B0j(ptr %b) {
|
219 | 253 | entry:
|
220 | 254 | %0 = load ptr, ptr %b, align 8
|
221 | 255 | %call = tail call i32 %0(ptr null, i32 0), !prof !0, !callsite !1
|
| 256 | + ;; Add a dummy call to ensure that we have some callsite metadata, |
| 257 | + ;; which triggers callsite record checking in the ThinLTO backend |
| 258 | + ;; even with -enable-memprof-indirect-call-support=false. |
| 259 | + %call2 = call i32 @_Z3xyzR2B0j(ptr null, i32 0), !callsite !2 |
222 | 260 | ret i32 0
|
223 | 261 | }
|
224 | 262 |
|
225 | 263 | !0 = !{!"VP", i32 0, i64 4, i64 4445083295448962937, i64 2, i64 -2718743882639408571, i64 2}
|
226 | 264 | !1 = !{i64 -2101080423462424381}
|
| 265 | +!2 = !{i64 1234} |
227 | 266 |
|
228 | 267 | ;--- main.ll
|
229 | 268 | 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"
|
|
0 commit comments