summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2016-10-04 18:13:45 +0000
committerHal Finkel <hfinkel@anl.gov>2016-10-04 18:13:45 +0000
commitbdd6735a9e1ad7196c7d57dbda97ca91a97d7929 (patch)
tree333828b0a40b1e05bc9ef81718ce03938dc286c1 /llvm
parent56f453563440024d1beffe7fa20e81a358b31d0a (diff)
downloadbcm5719-llvm-bdd6735a9e1ad7196c7d57dbda97ca91a97d7929.tar.gz
bcm5719-llvm-bdd6735a9e1ad7196c7d57dbda97ca91a97d7929.zip
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 llvm-svn: 283236
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp2
-rw-r--r--llvm/test/Transforms/Inline/optimization-remarks-yaml.ll2
2 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp b/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp
index d4359a88870..6584876f20a 100644
--- a/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp
+++ b/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp
@@ -134,7 +134,7 @@ void OptimizationRemarkEmitter::emit(DiagnosticInfoOptimizationBase &OptDiag) {
computeHotness(OptDiag);
yaml::Output *Out = F->getContext().getDiagnosticsOutputFile();
- if (Out && OptDiag.isEnabled()) {
+ if (Out) {
auto *P = &const_cast<DiagnosticInfoOptimizationBase &>(OptDiag);
*Out << P;
}
diff --git a/llvm/test/Transforms/Inline/optimization-remarks-yaml.ll b/llvm/test/Transforms/Inline/optimization-remarks-yaml.ll
index b3ee9faa108..870352d3b6d 100644
--- a/llvm/test/Transforms/Inline/optimization-remarks-yaml.ll
+++ b/llvm/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:
;
OpenPOWER on IntegriCloud