Skip to content

Commit cc1022c

Browse files
authored
[InstrProf] Remove deprecated -debug-info-correlate flag (#165289)
1 parent a98295d commit cc1022c

File tree

4 files changed

+7
-21
lines changed

4 files changed

+7
-21
lines changed

llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626

2727
namespace llvm {
2828

29-
LLVM_ABI extern cl::opt<bool> DebugInfoCorrelate;
30-
3129
class Function;
3230
class Instruction;
3331
class Module;

llvm/lib/Frontend/Driver/CodeGenOptions.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "llvm/TargetParser/Triple.h"
1313

1414
namespace llvm {
15-
extern llvm::cl::opt<bool> DebugInfoCorrelate;
1615
extern llvm::cl::opt<llvm::InstrProfCorrelator::ProfCorrelatorKind>
1716
ProfileCorrelate;
1817
} // namespace llvm
@@ -64,8 +63,7 @@ TargetLibraryInfoImpl *createTLII(const llvm::Triple &TargetTriple,
6463
}
6564

6665
std::string getDefaultProfileGenName() {
67-
return llvm::DebugInfoCorrelate ||
68-
llvm::ProfileCorrelate != InstrProfCorrelator::NONE
66+
return llvm::ProfileCorrelate != InstrProfCorrelator::NONE
6967
? "default_%m.proflite"
7068
: "default_%m.profraw";
7169
}

llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,6 @@ namespace llvm {
6969
// Command line option to enable vtable value profiling. Defined in
7070
// ProfileData/InstrProf.cpp: -enable-vtable-value-profiling=
7171
extern cl::opt<bool> EnableVTableValueProfiling;
72-
// TODO: Remove -debug-info-correlate in next LLVM release, in favor of
73-
// -profile-correlate=debug-info.
74-
cl::opt<bool> DebugInfoCorrelate(
75-
"debug-info-correlate",
76-
cl::desc("Use debug info to correlate profiles. (Deprecated, use "
77-
"-profile-correlate=debug-info)"),
78-
cl::init(false));
79-
8072
LLVM_ABI cl::opt<InstrProfCorrelator::ProfCorrelatorKind> ProfileCorrelate(
8173
"profile-correlate",
8274
cl::desc("Use debug info or binary file to correlate profiles."),
@@ -1047,7 +1039,7 @@ void InstrLowerer::lowerValueProfileInst(InstrProfValueProfileInst *Ind) {
10471039
// in lightweight mode. We need to move the value profile pointer to the
10481040
// Counter struct to get this working.
10491041
assert(
1050-
!DebugInfoCorrelate && ProfileCorrelate == InstrProfCorrelator::NONE &&
1042+
ProfileCorrelate == InstrProfCorrelator::NONE &&
10511043
"Value profiling is not yet supported with lightweight instrumentation");
10521044
GlobalVariable *Name = Ind->getName();
10531045
auto It = ProfileDataMap.find(Name);
@@ -1504,7 +1496,7 @@ static inline Constant *getVTableAddrForProfData(GlobalVariable *GV) {
15041496
}
15051497

15061498
void InstrLowerer::getOrCreateVTableProfData(GlobalVariable *GV) {
1507-
assert(!DebugInfoCorrelate &&
1499+
assert(ProfileCorrelate != InstrProfCorrelator::DEBUG_INFO &&
15081500
"Value profiling is not supported with lightweight instrumentation");
15091501
if (GV->isDeclaration() || GV->hasAvailableExternallyLinkage())
15101502
return;
@@ -1584,8 +1576,7 @@ GlobalVariable *InstrLowerer::setupProfileSection(InstrProfInstBase *Inc,
15841576

15851577
// Use internal rather than private linkage so the counter variable shows up
15861578
// in the symbol table when using debug info for correlation.
1587-
if ((DebugInfoCorrelate ||
1588-
ProfileCorrelate == InstrProfCorrelator::DEBUG_INFO) &&
1579+
if (ProfileCorrelate == InstrProfCorrelator::DEBUG_INFO &&
15891580
TT.isOSBinFormatMachO() && Linkage == GlobalValue::PrivateLinkage)
15901581
Linkage = GlobalValue::InternalLinkage;
15911582

@@ -1691,8 +1682,7 @@ InstrLowerer::getOrCreateRegionCounters(InstrProfCntrInstBase *Inc) {
16911682
auto *CounterPtr = setupProfileSection(Inc, IPSK_cnts);
16921683
PD.RegionCounters = CounterPtr;
16931684

1694-
if (DebugInfoCorrelate ||
1695-
ProfileCorrelate == InstrProfCorrelator::DEBUG_INFO) {
1685+
if (ProfileCorrelate == InstrProfCorrelator::DEBUG_INFO) {
16961686
LLVMContext &Ctx = M.getContext();
16971687
Function *Fn = Inc->getParent()->getParent();
16981688
if (auto *SP = Fn->getSubprogram()) {
@@ -1737,7 +1727,7 @@ InstrLowerer::getOrCreateRegionCounters(InstrProfCntrInstBase *Inc) {
17371727
void InstrLowerer::createDataVariable(InstrProfCntrInstBase *Inc) {
17381728
// When debug information is correlated to profile data, a data variable
17391729
// is not needed.
1740-
if (DebugInfoCorrelate || ProfileCorrelate == InstrProfCorrelator::DEBUG_INFO)
1730+
if (ProfileCorrelate == InstrProfCorrelator::DEBUG_INFO)
17411731
return;
17421732

17431733
GlobalVariable *NamePtr = Inc->getName();

llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ createIRLevelProfileFlagVar(Module &M,
456456
ProfileVersion |= VARIANT_MASK_INSTR_ENTRY;
457457
if (PGOInstrumentLoopEntries)
458458
ProfileVersion |= VARIANT_MASK_INSTR_LOOP_ENTRIES;
459-
if (DebugInfoCorrelate || ProfileCorrelate == InstrProfCorrelator::DEBUG_INFO)
459+
if (ProfileCorrelate == InstrProfCorrelator::DEBUG_INFO)
460460
ProfileVersion |= VARIANT_MASK_DBG_CORRELATE;
461461
if (PGOFunctionEntryCoverage)
462462
ProfileVersion |=

0 commit comments

Comments
 (0)