[llvm] r220386 - Change error to warning when a profile cannot be found.

Diego Novillo dnovillo at google.com
Wed Oct 22 06:36:35 PDT 2014


Author: dnovillo
Date: Wed Oct 22 08:36:35 2014
New Revision: 220386

URL: http://llvm.org/viewvc/llvm-project?rev=220386&view=rev
Log:
Change error to warning when a profile cannot be found.

When the profile for a function cannot be applied, we use to emit an
error. This seems extreme. The compiler can continue, it's just that the
optimization opportunities won't include profile information.

Modified:
    llvm/trunk/lib/Transforms/Scalar/SampleProfile.cpp
    llvm/trunk/test/Transforms/SampleProfile/syntax.ll

Modified: llvm/trunk/lib/Transforms/Scalar/SampleProfile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SampleProfile.cpp?rev=220386&r1=220385&r2=220386&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SampleProfile.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SampleProfile.cpp Wed Oct 22 08:36:35 2014
@@ -673,7 +673,9 @@ unsigned SampleProfileLoader::getFunctio
   // If could not find the start of \p F, emit a diagnostic to inform the user
   // about the missed opportunity.
   F.getContext().diagnose(DiagnosticInfoSampleProfile(
-      "No debug information found in function " + F.getName()));
+      "No debug information found in function " + F.getName() +
+          ": Function profile not used",
+      DS_Warning));
   return 0;
 }
 

Modified: llvm/trunk/test/Transforms/SampleProfile/syntax.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SampleProfile/syntax.ll?rev=220386&r1=220385&r2=220386&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/SampleProfile/syntax.ll (original)
+++ llvm/trunk/test/Transforms/SampleProfile/syntax.ll Wed Oct 22 08:36:35 2014
@@ -1,4 +1,4 @@
-; RUN: not opt < %s -sample-profile -sample-profile-file=%S/Inputs/syntax.prof 2>&1 | FileCheck -check-prefix=NO-DEBUG %s
+; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/syntax.prof 2>&1 | FileCheck -check-prefix=NO-DEBUG %s
 ; RUN: not opt < %s -sample-profile -sample-profile-file=missing.prof 2>&1 | FileCheck -check-prefix=MISSING-FILE %s
 ; RUN: not opt < %s -sample-profile -sample-profile-file=%S/Inputs/bad_fn_header.prof 2>&1 | FileCheck -check-prefix=BAD-FN-HEADER %s
 ; RUN: not opt < %s -sample-profile -sample-profile-file=%S/Inputs/bad_sample_line.prof 2>&1 | FileCheck -check-prefix=BAD-SAMPLE-LINE %s
@@ -11,7 +11,7 @@ define void @empty() {
 entry:
   ret void
 }
-; NO-DEBUG: error: No debug information found in function empty
+; NO-DEBUG: warning: No debug information found in function empty: Function profile not used
 ; MISSING-FILE: error: missing.prof:
 ; BAD-FN-HEADER: error: {{.*}}bad_fn_header.prof:1: Expected 'mangled_name:NUM:NUM', found 3empty:100:BAD
 ; BAD-SAMPLE-LINE: error: {{.*}}bad_sample_line.prof:3: Expected 'NUM[.NUM]: NUM[ mangled_name:NUM]*', found 1: BAD





More information about the llvm-commits mailing list