Skip to content

Commit f93cac9

Browse files
Address comments.
1 parent a475219 commit f93cac9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

llvm/lib/Transforms/Instrumentation/MemProfiler.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -818,9 +818,9 @@ static bool isAllocationWithHotColdVariant(const Function *Callee,
818818

819819
struct AllocMatchInfo {
820820
uint64_t TotalSize = 0;
821+
size_t NumFramesMatched = 0;
821822
AllocationType AllocType = AllocationType::None;
822823
bool Matched = false;
823-
size_t NumFramesMatched = 0;
824824
};
825825

826826
DenseMap<uint64_t, SmallVector<CallEdgeTy, 0>>
@@ -1153,8 +1153,8 @@ readMemprof(Module &M, Function &F, IndexedInstrProfReader *MemProfReader,
11531153
if (ClPrintMemProfMatchInfo) {
11541154
assert(FullStackId != 0);
11551155
FullStackIdToAllocMatchInfo[FullStackId] = {
1156-
AllocInfo->Info.getTotalSize(), AllocType, /*Matched=*/true,
1157-
InlinedCallStack.size()};
1156+
AllocInfo->Info.getTotalSize(), InlinedCallStack.size(),
1157+
AllocType, /*Matched=*/true};
11581158
}
11591159
}
11601160
}

llvm/test/Transforms/PGOProfile/memprof-dump-matched-alloc-site.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030

3131
;--- memprof-dump-matched-alloc-site.yaml
3232
---
33-
---
3433
HeapProfileRecords:
3534
- GUID: _Z2f3v
3635
AllocSites:
@@ -45,6 +44,7 @@ HeapProfileRecords:
4544
TotalLifetime: 0
4645
TotalLifetimeAccessDensity: 0
4746
CallSites:
47+
# Kept empty here because this section is irrelevant for this test.
4848
...
4949
;--- memprof-dump-matched-alloc-site.ll
5050
; CHECK: MemProf notcold context with id 12978026349401156968 has total profiled size 3 is matched with 3 frames

0 commit comments

Comments
 (0)