|
85 | 85 | ; RAND2: random hotness seed = 1730170724
|
86 | 86 | ; RUN: opt < %s -passes='memprof-use<profile-filename=%t.memprofdatarand2>' -pgo-warn-missing-function -S -stats 2>&1 | FileCheck %s --check-prefixes=MEMPROFRAND2,ALL,MEMPROFONLY,MEMPROFSTATS
|
87 | 87 |
|
| 88 | +;; With the hot access density threshold set to 0, and hot hints enabled, |
| 89 | +;; the unconditionally notcold call to new should instead get a hot attribute. |
| 90 | +; RUN: opt < %s -passes='memprof-use<profile-filename=%t.memprofdata>' -pgo-warn-missing-function -S -memprof-print-match-info -stats -memprof-min-ave-lifetime-access-density-hot-threshold=0 -memprof-use-hot-hints 2>&1 | FileCheck %s --check-prefixes=MEMPROFHOT,ALL |
| 91 | + |
| 92 | +;; However, with the same threshold, but hot hints not enabled, it should be |
| 93 | +;; notcold again. |
| 94 | +; RUN: opt < %s -passes='memprof-use<profile-filename=%t.memprofdata>' -pgo-warn-missing-function -S -memprof-min-ave-lifetime-access-density-hot-threshold=0 2>&1 | FileCheck %s --check-prefixes=MEMPROF,ALL |
| 95 | + |
88 | 96 | ; MEMPROFMATCHINFO: MemProf notcold context with id 1093248920606587996 has total profiled size 10 is matched
|
89 | 97 | ; MEMPROFMATCHINFO: MemProf notcold context with id 5725971306423925017 has total profiled size 10 is matched
|
90 | 98 | ; MEMPROFMATCHINFO: MemProf notcold context with id 6792096022461663180 has total profiled size 10 is matched
|
@@ -192,6 +200,7 @@ entry:
|
192 | 200 | store ptr %argv, ptr %argv.addr, align 8
|
193 | 201 | ; MEMPROF: call {{.*}} @_Znam{{.*}} #[[A1:[0-9]+]]
|
194 | 202 | ; MEMPROFNOCOLINFO: call {{.*}} @_Znam{{.*}} #[[A1:[0-9]+]]
|
| 203 | + ; MEMPROFHOT: call {{.*}} @_Znam{{.*}} #[[A1:[0-9]+]] |
195 | 204 | %call = call noalias noundef nonnull ptr @_Znam(i64 noundef 10) #6, !dbg !35
|
196 | 205 | store ptr %call, ptr %a, align 8, !dbg !36
|
197 | 206 | ; MEMPROF: call {{.*}} @_Znam{{.*}} #[[A2:[0-9]+]]
|
@@ -404,6 +413,8 @@ for.end: ; preds = %for.cond
|
404 | 413 | ; MEMPROFNOCOLINFO: ![[C10]] = !{i64 -4535090212904553409}
|
405 | 414 | ; MEMPROFNOCOLINFO: ![[C11]] = !{i64 3577763375057267810}
|
406 | 415 |
|
| 416 | +; MEMPROFHOT: #[[A1]] = { builtin allocsize(0) "memprof"="hot" } |
| 417 | + |
407 | 418 | ;; For the specific random seed, this is the expected order of hotness
|
408 | 419 | ; MEMPROFRAND2: !"cold"
|
409 | 420 | ; MEMPROFRAND2: !"cold"
|
|
0 commit comments