diff --git a/llvm/lib/LTO/LTOBackend.cpp b/llvm/lib/LTO/LTOBackend.cpp --- a/llvm/lib/LTO/LTOBackend.cpp +++ b/llvm/lib/LTO/LTOBackend.cpp @@ -75,7 +75,7 @@ "importing and the other pre-optimization pipeline changes.")); namespace llvm { -extern cl::opt NoPGOWarnMismatch; +extern cl::opt PGOWarnMismatch; } [[noreturn]] static void reportOpenError(StringRef Path, Twine Msg) { @@ -225,7 +225,7 @@ PGOOpt = PGOOptions(Conf.CSIRProfile, "", Conf.ProfileRemapping, PGOOptions::IRUse, PGOOptions::CSIRUse, Conf.AddFSDiscriminator); - NoPGOWarnMismatch = !Conf.PGOWarnMismatch; + PGOWarnMismatch = Conf.PGOWarnMismatch; } else if (Conf.AddFSDiscriminator) { PGOOpt = PGOOptions("", "", "", PGOOptions::NoAction, PGOOptions::NoCSAction, true); diff --git a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp --- a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp +++ b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp @@ -201,21 +201,18 @@ namespace llvm { // Command line option to enable/disable the warning about a hash mismatch in // the profile data. -cl::opt - NoPGOWarnMismatch("no-pgo-warn-mismatch", cl::init(false), cl::Hidden, - cl::desc("Use this option to turn off/on " - "warnings about profile cfg mismatch.")); +cl::opt PGOWarnMismatch("pgo-warn-mismatch", cl::init(true), cl::Hidden, + cl::desc("Warn about profile cfg mismatch")); } // namespace llvm // Command line option to enable/disable the warning about a hash mismatch in // the profile data for Comdat functions, which often turns out to be false // positive due to the pre-instrumentation inline. static cl::opt - NoPGOWarnMismatchComdat("no-pgo-warn-mismatch-comdat", cl::init(true), - cl::Hidden, - cl::desc("The option is used to turn on/off " - "warnings about hash mismatch for comdat " - "functions.")); + PGOWarnMismatchComdat("pgo-warn-mismatch-comdat", cl::init(false), + cl::Hidden, + cl::desc("Warn about hash mismatch for comdat " + "functions")); // Command line option to enable/disable select instruction instrumentation. static cl::opt @@ -1293,8 +1290,8 @@ Err == instrprof_error::malformed) { IsCS ? NumOfCSPGOMismatch++ : NumOfPGOMismatch++; SkipWarning = - NoPGOWarnMismatch || - (NoPGOWarnMismatchComdat && + !PGOWarnMismatch || + (!PGOWarnMismatchComdat && (F.hasComdat() || F.getLinkage() == GlobalValue::AvailableExternallyLinkage)); LLVM_DEBUG(dbgs() << "hash mismatch (skip=" << SkipWarning << ")");