@@ -298,7 +298,9 @@ static cl::opt<bool> UseLoopVersioningLICM(
298298
299299static cl::opt<std::string> InstrumentColdFuncOnlyPath (
300300 " instrument-cold-function-only-path" , cl::init(" " ),
301- cl::desc(" File path for cold function only instrumentation" ), cl::Hidden);
301+ cl::desc(" File path for cold function only instrumentation(requires use "
302+ " with --pgo-instrument-cold-function-only)" ),
303+ cl::Hidden);
302304
303305extern cl::opt<std::string> UseCtxProfile;
304306extern cl::opt<bool > PGOInstrumentColdFunctionOnly;
@@ -1188,10 +1190,13 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
11881190 const bool IsCtxProfUse =
11891191 !UseCtxProfile.empty () && Phase == ThinOrFullLTOPhase::ThinLTOPreLink;
11901192
1191- // Enable cold function coverage instrumentation if
1192- // InstrumentColdFuncOnlyPath is provided.
1193- const bool IsColdFuncOnlyInstrGen = PGOInstrumentColdFunctionOnly =
1194- IsPGOPreLink && !InstrumentColdFuncOnlyPath.empty ();
1193+ assert (
1194+ (InstrumentColdFuncOnlyPath.empty () || PGOInstrumentColdFunctionOnly) &&
1195+ " --instrument-cold-function-only-path is provided but "
1196+ " --pgo-instrument-cold-function-only is not enabled" );
1197+ const bool IsColdFuncOnlyInstrGen = PGOInstrumentColdFunctionOnly &&
1198+ IsPGOPreLink &&
1199+ !InstrumentColdFuncOnlyPath.empty ();
11951200
11961201 if (IsPGOInstrGen || IsPGOInstrUse || IsMemprofUse || IsCtxProfGen ||
11971202 IsCtxProfUse || IsColdFuncOnlyInstrGen)
0 commit comments