Skip to content

Commit b1f0105

Browse files
committed
address comments
1 parent 66f837a commit b1f0105

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ static cl::opt<uint64_t> ColdFuncCoverageMaxEntryCount(
328328
static cl::opt<InstrColdFuncCovMode> InstrumentColdFunctionCoverageMode(
329329
"instrument-cold-function-coverage-mode",
330330
cl::init(InstrColdFuncCovMode::Conservative), cl::Hidden,
331-
cl::desc("Control whether instrumenting unprofiled functions for cold "
331+
cl::desc("Control whether to instrument unprofiled functions for cold "
332332
"function coverage."),
333333
cl::values(
334334
clEnumValN(InstrColdFuncCovMode::Conservative, "conservative",
@@ -1915,10 +1915,10 @@ static bool skipPGOGen(const Function &F) {
19151915
if (F.getInstructionCount() < PGOFunctionSizeThreshold)
19161916
return true;
19171917
if (InstrumentColdFunctionCoverage) {
1918-
if (!F.getEntryCount())
1919-
return InstrumentColdFunctionCoverageMode ==
1920-
InstrColdFuncCovMode::Conservative;
1921-
return F.getEntryCount()->getCount() > ColdFuncCoverageMaxEntryCount;
1918+
if (auto EntryCount = F.getEntryCount())
1919+
return EntryCount->getCount() > ColdFuncCoverageMaxEntryCount;
1920+
return InstrumentColdFunctionCoverageMode ==
1921+
InstrColdFuncCovMode::Conservative;
19221922
}
19231923
return false;
19241924
}

0 commit comments

Comments
 (0)