diff options
| author | Adam Nemet <anemet@apple.com> | 2017-10-04 04:26:23 +0000 |
|---|---|---|
| committer | Adam Nemet <anemet@apple.com> | 2017-10-04 04:26:23 +0000 |
| commit | f31b1f310c7c9d90adbad35dd17732c6683d1c27 (patch) | |
| tree | e71af14d885376e64750e5fa9318e339af8c891b /llvm/lib/IR | |
| parent | 28c2c22624dd03f56862b62fd1c2ccea8d22cdd8 (diff) | |
| download | bcm5719-llvm-f31b1f310c7c9d90adbad35dd17732c6683d1c27.tar.gz bcm5719-llvm-f31b1f310c7c9d90adbad35dd17732c6683d1c27.zip | |
Move verbosity check for remarks to the diag handler
Test needs some slight adjustment because we no longer check the existence of
BFI but rather that the actual hotness is set on the remark. If entry_count
is not set getBlockProfileCount returns None.
llvm-svn: 314874
Diffstat (limited to 'llvm/lib/IR')
| -rw-r--r-- | llvm/lib/IR/LLVMContext.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/IR/LLVMContext.cpp b/llvm/lib/IR/LLVMContext.cpp index 6569695c996..ead65ecfdb8 100644 --- a/llvm/lib/IR/LLVMContext.cpp +++ b/llvm/lib/IR/LLVMContext.cpp @@ -199,8 +199,12 @@ static bool isDiagnosticEnabled(const DiagnosticInfo &DI) { // pattern, passed via one of the -pass-remarks* flags, matches the name of // the pass that is emitting the diagnostic. If there is no match, ignore the // diagnostic and return. + // + // Also noisy remarks are only enabled if we have hotness information to sort + // them. if (auto *Remark = dyn_cast<DiagnosticInfoOptimizationBase>(&DI)) - return Remark->isEnabled(); + return Remark->isEnabled() && + (!Remark->isVerbose() || Remark->getHotness()); return true; } |

