Skip to content

Commit ce6a96b

Browse files
Address the feedback.
1 parent 9463fcf commit ce6a96b

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

llvm/lib/Transforms/Instrumentation/MemProfiler.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -862,8 +862,10 @@ memprof::computeUndriftMap(Module &M, IndexedInstrProfReader *MemProfReader,
862862
const TargetLibraryInfo &TLI) {
863863
DenseMap<uint64_t, LocToLocMap> UndriftMaps;
864864

865-
auto CallsFromProfile = MemProfReader->getMemProfCallerCalleePairs();
866-
auto CallsFromIR = extractCallsFromIR(M, TLI);
865+
DenseMap<uint64_t, SmallVector<memprof::CallEdgeTy, 0>> CallsFromProfile =
866+
MemProfReader->getMemProfCallerCalleePairs();
867+
DenseMap<uint64_t, SmallVector<memprof::CallEdgeTy, 0>> CallsFromIR =
868+
extractCallsFromIR(M, TLI);
867869

868870
// Compute an undrift map for each CallerGUID.
869871
for (const auto &[CallerGUID, IRAnchors] : CallsFromIR) {

llvm/unittests/Transforms/Instrumentation/MemProfUseTest.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,19 +320,19 @@ makeRecordV2(std::initializer_list<::llvm::memprof::CallStackId> AllocFrames,
320320
std::initializer_list<::llvm::memprof::CallStackId> CallSiteFrames,
321321
const MemInfoBlock &Block, const memprof::MemProfSchema &Schema) {
322322
llvm::memprof::IndexedMemProfRecord MR;
323-
for (const auto &CSId : AllocFrames)
323+
for (const auto &CSId : AllocFrames) {
324324
// We don't populate IndexedAllocationInfo::CallStack because we use it only
325325
// in Version1.
326-
MR.AllocSites.emplace_back(::llvm::SmallVector<memprof::FrameId>(), CSId,
327-
Block, Schema);
326+
MR.AllocSites.push_back({{}, CSId, Block, Schema});
327+
}
328328
for (const auto &CSId : CallSiteFrames)
329329
MR.CallSiteIds.push_back(CSId);
330330
return MR;
331331
}
332332

333333
static const auto Err = [](Error E) {
334+
FAIL() << E;
334335
consumeError(std::move(E));
335-
FAIL();
336336
};
337337

338338
// Make sure that we can undrift direct calls.

0 commit comments

Comments
 (0)