summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
diff options
context:
space:
mode:
authorTyler Nowicki <tyler.nowicki@gmail.com>2015-08-11 01:09:15 +0000
committerTyler Nowicki <tyler.nowicki@gmail.com>2015-08-11 01:09:15 +0000
commitc94d6ad241782de3d44a930db5990162da1c309e (patch)
tree581d4b0eaeb8d9faedca5e6a7ed49830562b6dc3 /llvm/lib/IR
parent149d04c29a7bb86df5c6fcfaee90098db2e3c9dd (diff)
downloadbcm5719-llvm-c94d6ad241782de3d44a930db5990162da1c309e.tar.gz
bcm5719-llvm-c94d6ad241782de3d44a930db5990162da1c309e.zip
Print vectorization analysis when loop hint is specified.
This patch and a relatec clang patch solve the problem of having to explicitly enable analysis when specifying a loop hint pragma to get the diagnostics. Passing AlwasyPrint as the pass name (see below) causes the front-end to print the diagnostic if the user has specified '-Rpass-analysis' without an '=<target-pass>’. Users of loop hints can pass that compiler option without having to specify the pass and they will get diagnostics for only those loops with loop hints. llvm-svn: 244555
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/DiagnosticInfo.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/IR/DiagnosticInfo.cpp b/llvm/lib/IR/DiagnosticInfo.cpp
index 3acef9048cc..eab14e69eaa 100644
--- a/llvm/lib/IR/DiagnosticInfo.cpp
+++ b/llvm/lib/IR/DiagnosticInfo.cpp
@@ -91,6 +91,8 @@ int llvm::getNextAvailablePluginDiagnosticKind() {
return ++PluginKindID;
}
+const char *DiagnosticInfo::AlwaysPrint = "";
+
DiagnosticInfoInlineAsm::DiagnosticInfoInlineAsm(const Instruction &I,
const Twine &MsgStr,
DiagnosticSeverity Severity)
@@ -166,8 +168,9 @@ bool DiagnosticInfoOptimizationRemarkMissed::isEnabled() const {
}
bool DiagnosticInfoOptimizationRemarkAnalysis::isEnabled() const {
- return PassRemarksAnalysisOptLoc.Pattern &&
- PassRemarksAnalysisOptLoc.Pattern->match(getPassName());
+ return getPassName() == DiagnosticInfo::AlwaysPrint ||
+ (PassRemarksAnalysisOptLoc.Pattern &&
+ PassRemarksAnalysisOptLoc.Pattern->match(getPassName()));
}
void DiagnosticInfoMIRParser::print(DiagnosticPrinter &DP) const {
OpenPOWER on IntegriCloud