186
186
; REMARKS-MAIN: created clone _ZN2B03barEj.memprof.1
187
187
; REMARKS-MAIN: call in clone _ZN2B03barEj marked with memprof allocation attribute notcold
188
188
; REMARKS-MAIN: call in clone _ZN2B03barEj.memprof.1 marked with memprof allocation attribute cold
189
+ ; REMARKS-MAIN: call in clone _ZN2B03barEj marked with memprof allocation attribute notcold
190
+ ; REMARKS-MAIN: call in clone _ZN2B03barEj.memprof.1 marked with memprof allocation attribute cold
189
191
; REMARKS-MAIN: created clone _ZN1B3barEj.memprof.1
190
192
; REMARKS-MAIN: call in clone _ZN1B3barEj marked with memprof allocation attribute notcold
191
193
; REMARKS-MAIN: call in clone _ZN1B3barEj.memprof.1 marked with memprof allocation attribute cold
194
+ ; REMARKS-MAIN: call in clone _ZN1B3barEj marked with memprof allocation attribute notcold
195
+ ; REMARKS-MAIN: call in clone _ZN1B3barEj.memprof.1 marked with memprof allocation attribute cold
192
196
; REMARKS-FOO: created clone _Z3fooR2B0j.memprof.1
193
197
;; In each version of foo we should have promoted the indirect call to two conditional
194
198
;; direct calls, one to B::bar and one to B0::bar. The cloned version of foo should call
208
212
; REMARKS-FOO: call in clone _ZN1B3barEj marked with memprof allocation attribute notcold
209
213
; REMARKS-FOO: call in clone _ZN1B3barEj.memprof.1 marked with memprof allocation attribute cold
210
214
211
- ; STATS: 2 memprof-context-disambiguation - Number of cold static allocations (possibly cloned) during whole program analysis
212
- ; STATS-BE: 4 memprof-context-disambiguation - Number of cold static allocations (possibly cloned) during ThinLTO backend
213
- ; STATS: 2 memprof-context-disambiguation - Number of not cold static allocations (possibly cloned) during whole program analysis
214
- ; STATS-BE: 4 memprof-context-disambiguation - Number of not cold static allocations (possibly cloned) during ThinLTO backend
215
+ ; STATS: 4 memprof-context-disambiguation - Number of cold static allocations (possibly cloned) during whole program analysis
216
+ ; STATS-BE: 8 memprof-context-disambiguation - Number of cold static allocations (possibly cloned) during ThinLTO backend
217
+ ; STATS: 4 memprof-context-disambiguation - Number of not cold static allocations (possibly cloned) during whole program analysis
218
+ ; STATS-BE: 8 memprof-context-disambiguation - Number of not cold static allocations (possibly cloned) during ThinLTO backend
215
219
; STATS: 3 memprof-context-disambiguation - Number of function clones created during whole program analysis
216
220
; STATS-BE: 5 memprof-context-disambiguation - Number of function clones created during ThinLTO backend
217
221
247
251
; IR: attributes #[[NOTCOLD]] = {{.*}} "memprof"="notcold"
248
252
; IR: attributes #[[COLD]] = {{.*}} "memprof"="cold"
249
253
250
- ; STATS-BE-DISTRIB: 2 memprof-context-disambiguation - Number of cold static allocations (possibly cloned) during ThinLTO backend
251
- ; STATS-BE-DISTRIB: 2 memprof-context-disambiguation - Number of not cold static allocations (possibly cloned) during ThinLTO backend
254
+ ; STATS-BE-DISTRIB: 4 memprof-context-disambiguation - Number of cold static allocations (possibly cloned) during ThinLTO backend
255
+ ; STATS-BE-DISTRIB: 4 memprof-context-disambiguation - Number of not cold static allocations (possibly cloned) during ThinLTO backend
252
256
; STATS-BE-DISTRIB: 3 memprof-context-disambiguation - Number of function clones created during ThinLTO backend
253
257
254
258
;--- foo.ll
@@ -298,6 +302,9 @@ declare i32 @_Z3fooR2B0j(ptr, i32)
298
302
define i32 @_ZN2B03barEj (ptr %this , i32 %s ) {
299
303
entry:
300
304
%call = tail call ptr @_Znwm (i64 noundef 4 ) #0 , !memprof !33 , !callsite !38
305
+ ;; Second allocation in this function, to ensure that indirect edges to the
306
+ ;; same callee are partitioned correctly.
307
+ %call2 = tail call ptr @_Znwm (i64 noundef 4 ) #0 , !memprof !45 , !callsite !50
301
308
store volatile i32 0 , ptr %call , align 4
302
309
ret i32 0
303
310
}
@@ -311,6 +318,9 @@ declare void @_ZdlPvm()
311
318
define i32 @_ZN1B3barEj (ptr %this , i32 %s ) {
312
319
entry:
313
320
%call = tail call ptr @_Znwm (i64 noundef 4 ) #0 , !memprof !39 , !callsite !44
321
+ ;; Second allocation in this function, to ensure that indirect edges to the
322
+ ;; same callee are partitioned correctly.
323
+ %call2 = tail call ptr @_Znwm (i64 noundef 4 ) #0 , !memprof !51 , !callsite !56
314
324
store volatile i32 0 , ptr %call , align 4
315
325
ret i32 0
316
326
}
@@ -367,3 +377,15 @@ attributes #0 = { builtin allocsize(0) }
367
377
!42 = !{!43 , !"cold" }
368
378
!43 = !{i64 4457553070050523782 , i64 -2101080423462424381 , i64 -6490791336773930154 }
369
379
!44 = !{i64 4457553070050523782 }
380
+ !45 = !{!46 , !48 }
381
+ !46 = !{!47 , !"notcold" }
382
+ !47 = !{i64 456 , i64 -2101080423462424381 , i64 5188446645037944434 }
383
+ !48 = !{!49 , !"cold" }
384
+ !49 = !{i64 456 , i64 -2101080423462424381 , i64 5583420417449503557 }
385
+ !50 = !{i64 456 }
386
+ !51 = !{!52 , !54 }
387
+ !52 = !{!53 , !"notcold" }
388
+ !53 = !{i64 789 , i64 -2101080423462424381 , i64 132626519179914298 }
389
+ !54 = !{!55 , !"cold" }
390
+ !55 = !{i64 789 , i64 -2101080423462424381 , i64 -6490791336773930154 }
391
+ !56 = !{i64 789 }
0 commit comments