Skip to content

Commit 491042e

Browse files
Rename the option to memprof-salvage-stale-profile.
1 parent a8fa34b commit 491042e

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

llvm/lib/Transforms/Instrumentation/MemProfiler.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,10 @@ static cl::opt<std::string>
171171
cl::desc("The default memprof options"),
172172
cl::Hidden, cl::init(""));
173173

174-
static cl::opt<bool> UndriftProfile("memprof-undrift-profile",
175-
cl::desc("Undrift MemProf profile"),
176-
cl::init(false), cl::Hidden);
174+
static cl::opt<bool>
175+
SalvageStaleProfile("memprof-salvage-stale-profile",
176+
cl::desc("Salvage stale MemProf profile"),
177+
cl::init(false), cl::Hidden);
177178

178179
extern cl::opt<bool> MemProfReportHintedSizes;
179180

@@ -992,7 +993,7 @@ readMemprof(Module &M, Function &F, IndexedInstrProfReader *MemProfReader,
992993

993994
// If requested, undrfit MemProfRecord so that the source locations in it
994995
// match those in the IR.
995-
if (UndriftProfile)
996+
if (SalvageStaleProfile)
996997
undriftMemProfRecord(UndriftMaps, *MemProfRec);
997998

998999
// Detect if there are non-zero column numbers in the profile. If not,
@@ -1215,7 +1216,7 @@ PreservedAnalyses MemProfUsePass::run(Module &M, ModuleAnalysisManager &AM) {
12151216

12161217
TargetLibraryInfo &TLI = FAM.getResult<TargetLibraryAnalysis>(*M.begin());
12171218
DenseMap<uint64_t, LocToLocMap> UndriftMaps;
1218-
if (UndriftProfile)
1219+
if (SalvageStaleProfile)
12191220
UndriftMaps = computeUndriftMap(M, MemProfReader.get(), TLI);
12201221

12211222
// Map from the stack has of each allocation context in the function profiles

llvm/test/Transforms/PGOProfile/memprof-undrift.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
; RUN: split-file %s %t
77
; RUN: llvm-profdata merge %t/memprof_annotate_yaml.yaml -o %t/memprof_annotate_yaml.memprofdata
8-
; RUN: opt < %t/memprof_annotate_yaml.ll -passes='memprof-use<profile-filename=%t/memprof_annotate_yaml.memprofdata>' -memprof-undrift-profile -S 2>&1 | FileCheck %s
8+
; RUN: opt < %t/memprof_annotate_yaml.ll -passes='memprof-use<profile-filename=%t/memprof_annotate_yaml.memprofdata>' -memprof-salvage-stale-profile -S 2>&1 | FileCheck %s
99

1010
;--- memprof_annotate_yaml.yaml
1111
---

0 commit comments

Comments
 (0)