Index: lib/Transforms/Instrumentation/PGOInstrumentation.cpp =================================================================== --- lib/Transforms/Instrumentation/PGOInstrumentation.cpp +++ lib/Transforms/Instrumentation/PGOInstrumentation.cpp @@ -956,7 +956,7 @@ std::string Msg = IPE.message() + std::string(" ") + F.getName().str(); Ctx.diagnose( - DiagnosticInfoPGOProfile(M->getName().data(), Msg, DS_Warning)); + DiagnosticInfoPGOProfile(M->getName().data(), Msg, DS_Remark)); }); return false; } @@ -1346,11 +1346,7 @@ std::unique_ptr PGOReader = std::move(ReaderOrErr.get()); - if (!PGOReader) { - Ctx.diagnose(DiagnosticInfoPGOProfile(ProfileFileName.data(), - StringRef("Cannot get PGOReader"))); - return false; - } + assert(PGOReader); // TODO: might need to change the warning once the clang option is finalized. if (!PGOReader->isIRLevelProfile()) { Ctx.diagnose(DiagnosticInfoPGOProfile( Index: test/Transforms/PGOProfile/diag_FE_profile.ll =================================================================== --- test/Transforms/PGOProfile/diag_FE_profile.ll +++ test/Transforms/PGOProfile/diag_FE_profile.ll @@ -2,7 +2,7 @@ ; RUN: not opt < %s -pgo-instr-use -pgo-test-profile-file=%t.profdata -S 2>&1 | FileCheck %s ; RUN: not opt < %s -passes=pgo-instr-use -pgo-test-profile-file=%t.profdata -S 2>&1 | FileCheck %s -; CHECK: Not an IR level instrumentation profile +; CHECK: error: {{.*}}.profdata: Not an IR level instrumentation profile target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" Index: test/Transforms/PGOProfile/diag_mismatch.ll =================================================================== --- test/Transforms/PGOProfile/diag_mismatch.ll +++ test/Transforms/PGOProfile/diag_mismatch.ll @@ -2,7 +2,7 @@ ; RUN: opt < %s -pgo-instr-use -pgo-test-profile-file=%t.profdata -S 2>&1 | FileCheck %s ; RUN: opt < %s -passes=pgo-instr-use -pgo-test-profile-file=%t.profdata -S 2>&1 | FileCheck %s -; CHECK: Function control flow change detected (hash mismatch) foo +; CHECK: remark: : Function control flow change detected (hash mismatch) foo target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" Index: test/Transforms/PGOProfile/diag_no_funcprofdata.ll =================================================================== --- test/Transforms/PGOProfile/diag_no_funcprofdata.ll +++ test/Transforms/PGOProfile/diag_no_funcprofdata.ll @@ -5,7 +5,7 @@ ; RUN: opt < %s -pgo-instr-use -pgo-test-profile-file=%t.profdata -S 2>&1 | FileCheck %s --check-prefix=DEFAULT ; RUN: opt < %s -passes=pgo-instr-use -pgo-test-profile-file=%t.profdata -S 2>&1 | FileCheck %s --check-prefix=DEFAULT -; CHECK: No profile data available for function bar +; CHECK: remark: : No profile data available for function bar ; DEFAULT-NOT: No profile data available for function bar target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"