Skip to content

Commit abbf611

Browse files
committed
Add a few more comments
1 parent 6196acf commit abbf611

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4477,6 +4477,9 @@ bool MemProfContextDisambiguation::applyImport(Module &M) {
44774477
// will still be none type or should have gotten the default NotCold.
44784478
// Skip that after calling clone helper since that does some sanity
44794479
// checks that confirm we haven't decided yet that we need cloning.
4480+
// We might have a single version that is cold due to the
4481+
// MinClonedColdBytePercent heuristic, make sure we don't skip in that
4482+
// case.
44804483
if (AllocNode.Versions.size() == 1 &&
44814484
(AllocationType)AllocNode.Versions[0] != AllocationType::Cold) {
44824485
assert((AllocationType)AllocNode.Versions[0] ==

llvm/test/ThinLTO/X86/memprof-missing-callsite.ll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
; RUN: --check-prefix=SIZESUNHINTED
3232
; RUN: llvm-dis %t.out.1.4.opt.bc -o - | FileCheck %s --implicit-check-not "\"memprof\"=\"cold\""
3333

34+
;; Check that we do hint with a sufficient -memprof-cloning-cold-threshold.
3435
; RUN: opt -thinlto-bc -memprof-report-hinted-sizes %s >%t.o
3536
; RUN: llvm-lto2 run %t.o -enable-memprof-context-disambiguation \
3637
; RUN: -supports-hot-cold-new \
@@ -42,6 +43,8 @@
4243
; RUN: --check-prefix=SIZESHINTED
4344
; RUN: llvm-dis %t.out.1.4.opt.bc -o - | FileCheck %s --check-prefix=IRHINTED
4445

46+
;; Check again that we hint with a sufficient -memprof-cloning-cold-threshold,
47+
;; even if we don't specify -memprof-report-hinted-sizes.
4548
; RUN: opt -thinlto-bc -memprof-report-hinted-sizes %s >%t.o
4649
; RUN: llvm-lto2 run %t.o -enable-memprof-context-disambiguation \
4750
; RUN: -supports-hot-cold-new \

0 commit comments

Comments
 (0)