Add an option to prevent diagnostics that do not meet a minimum hotness
threshold from being output. When generating optimization remarks for
large codebases with a ton of cold code paths, this option can be used
to limit the optimization remark output at a reasonable size. Discussion of
this change can be read here:
http://lists.llvm.org/pipermail/llvm-dev/2017-June/114377.html
Details
Diff Detail
- Build Status
Buildable 7840 Build 7840: arc lint + arc unit
Event Timeline
include/llvm/IR/LLVMContext.h | ||
---|---|---|
196–199 | I had originally thought that there should be a distinction between "the threshold has been set to zero" and "the threshold has not been set", but taking another look at this patch and the one to Clang, I realize there isn't a need for it. I'll remove the Optional<> here, good call! | |
lib/Analysis/OptimizationDiagnosticInfo.cpp | ||
159–165 | Oh, good catch, thank you! Do you know if there's an existing test for MachineOptimizationRemarkEmitter? |
lib/Analysis/OptimizationDiagnosticInfo.cpp | ||
---|---|---|
159–165 | There are a few, look for pass-remarks under test/CodeGen. The one I originally added is test/CodeGen/AArch64/arm64-spill-remarks.ll. |
Add hotness threshold check to MachineOptimizationRemarkEmitter, and change the threshold attribute type for LLVMContext from an optional unsigned to just an unsigned.
Add tests for the MachineOptimizationRemarkEmitter codepath, to test/CodeGen/AArch64/arm64-spill-remarks.ll.
What's the difference between None and 0?