[PATCH] D25224: Don't filter diagnostics written as YAML to the output file

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 3 23:39:43 PDT 2016


hfinkel created this revision.
hfinkel added a reviewer: anemet.
hfinkel added a subscriber: llvm-commits.
Herald added a subscriber: mcrosier.

The purpose of the YAML diagnostic output file is to collect information on optimizations performed, or not performed, for later processing by tools that help users (and compiler developers) understand how code was optimized. As such, the diagnostics that appear in the file should not be coupled to what a user might want to see summarized for them as the compiler runs, and in fact, because the user likely does not know what optimization diagnostics their tools might want to use, the user cannot provide a useful filter regardless. As such, we shouldn't filter the diagnostics going to the output file.


https://reviews.llvm.org/D25224

Files:
  lib/Analysis/OptimizationDiagnosticInfo.cpp
  test/Transforms/Inline/optimization-remarks-yaml.ll


Index: test/Transforms/Inline/optimization-remarks-yaml.ll
===================================================================
--- test/Transforms/Inline/optimization-remarks-yaml.ll
+++ test/Transforms/Inline/optimization-remarks-yaml.ll
@@ -1,6 +1,8 @@
 ; RUN: opt < %s -S -inline -pass-remarks-missed=inline -pass-remarks-with-hotness \
 ; RUN:     -pass-remarks-output=%t 2>&1 | FileCheck %s
 ; RUN: cat %t | FileCheck -check-prefix=YAML %s
+; RUN: opt < %s -S -inline -pass-remarks-with-hotness -pass-remarks-output=%t
+; RUN: cat %t | FileCheck -check-prefix=YAML %s
 
 ; Check the YAML file generated for inliner remarks for this program:
 ;
Index: lib/Analysis/OptimizationDiagnosticInfo.cpp
===================================================================
--- lib/Analysis/OptimizationDiagnosticInfo.cpp
+++ lib/Analysis/OptimizationDiagnosticInfo.cpp
@@ -132,7 +132,7 @@
   computeHotness(OptDiag);
 
   yaml::Output *Out = F->getContext().getDiagnosticsOutputFile();
-  if (Out && OptDiag.isEnabled()) {
+  if (Out) {
     auto *P = &const_cast<DiagnosticInfoOptimizationBase &>(OptDiag);
     *Out << P;
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25224.73399.patch
Type: text/x-patch
Size: 1124 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161004/b0b06ff9/attachment.bin>


More information about the llvm-commits mailing list