[PATCH] D23295: [Profile]: make 'no profile data' warning off by default

David Li via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 8 22:03:25 PDT 2016


davidxl created this revision.
davidxl added reviewers: xur, silvas.
davidxl added a subscriber: llvm-commits.

With any large project, it is very common that many modules in static archive never get linked in the the final instrumented executable, thus functions defined in those modules won't have profile data collected.  As a result, during profile-use compilation, we will end up getting tons of 'no profile data available for function ...' warnings which is not useful at all. A better way to handle this is to enhance profile runtime to record the modules that are linked in (at the cost of slightly increased profile size)

This patch makes the emission of such warnings off by default.

https://reviews.llvm.org/D23295

Files:
  lib/Transforms/Instrumentation/PGOInstrumentation.cpp
  test/Transforms/PGOProfile/diag_no_funcprofdata.ll

Index: test/Transforms/PGOProfile/diag_no_funcprofdata.ll
===================================================================
--- test/Transforms/PGOProfile/diag_no_funcprofdata.ll
+++ test/Transforms/PGOProfile/diag_no_funcprofdata.ll
@@ -1,6 +1,6 @@
 ; RUN: llvm-profdata merge %S/Inputs/diag.proftext -o %t.profdata
-; 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
+; RUN: opt < %s -pgo-instr-use -no-pgo-warn-missing=false -pgo-test-profile-file=%t.profdata -S 2>&1 | FileCheck %s
+; RUN: opt < %s -passes=pgo-instr-use -no-pgo-warn-missing=false -pgo-test-profile-file=%t.profdata -S 2>&1 | FileCheck %s
 
 ; CHECK: No profile data available for function bar
 
Index: lib/Transforms/Instrumentation/PGOInstrumentation.cpp
===================================================================
--- lib/Transforms/Instrumentation/PGOInstrumentation.cpp
+++ lib/Transforms/Instrumentation/PGOInstrumentation.cpp
@@ -124,7 +124,7 @@
 
 // Command line option to enable/disable the warning about missing profile
 // information.
-static cl::opt<bool> NoPGOWarnMissing("no-pgo-warn-missing", cl::init(false),
+static cl::opt<bool> NoPGOWarnMissing("no-pgo-warn-missing", cl::init(true),
                                       cl::Hidden);
 
 // Command line option to enable/disable the warning about a hash mismatch in


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23295.67284.patch
Type: text/x-patch
Size: 1454 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160809/f5bd50ed/attachment.bin>


More information about the llvm-commits mailing list