[llvm] r283236 - Don't filter diagnostics written as YAML to the output file

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 4 11:13:45 PDT 2016


Author: hfinkel
Date: Tue Oct  4 13:13:45 2016
New Revision: 283236

URL: http://llvm.org/viewvc/llvm-project?rev=283236&view=rev
Log:
Don't filter diagnostics written as YAML to the output file

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.

Differential Revision: https://reviews.llvm.org/D25224

Modified:
    llvm/trunk/lib/Analysis/OptimizationDiagnosticInfo.cpp
    llvm/trunk/test/Transforms/Inline/optimization-remarks-yaml.ll

Modified: llvm/trunk/lib/Analysis/OptimizationDiagnosticInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/OptimizationDiagnosticInfo.cpp?rev=283236&r1=283235&r2=283236&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/OptimizationDiagnosticInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/OptimizationDiagnosticInfo.cpp Tue Oct  4 13:13:45 2016
@@ -134,7 +134,7 @@ void OptimizationRemarkEmitter::emit(Dia
   computeHotness(OptDiag);
 
   yaml::Output *Out = F->getContext().getDiagnosticsOutputFile();
-  if (Out && OptDiag.isEnabled()) {
+  if (Out) {
     auto *P = &const_cast<DiagnosticInfoOptimizationBase &>(OptDiag);
     *Out << P;
   }

Modified: llvm/trunk/test/Transforms/Inline/optimization-remarks-yaml.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/optimization-remarks-yaml.ll?rev=283236&r1=283235&r2=283236&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/Inline/optimization-remarks-yaml.ll (original)
+++ llvm/trunk/test/Transforms/Inline/optimization-remarks-yaml.ll Tue Oct  4 13:13:45 2016
@@ -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:
 ;




More information about the llvm-commits mailing list