[PATCH] D34867: [ORE] Add diagnostics hotness threshold

Adam Nemet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 30 05:24:09 PDT 2017


anemet added a reviewer: hfinkel.
anemet added a comment.

Great!



================
Comment at: include/llvm/IR/LLVMContext.h:196-199
+  /// \brief Return the minimum hotness value a diagnostic would need in order
+  /// to be included in optimization diagnostics. If there is no minimum, this
+  /// returns None.
+  Optional<uint64_t> getDiagnosticsHotnessThreshold() const;
----------------
What's the difference between None and 0?


================
Comment at: lib/Analysis/OptimizationDiagnosticInfo.cpp:159-165
+  // If a diagnostic has a hotness value, then only emit it if its hotness
+  // meets the threshold.
+  auto Threshold = F->getContext().getDiagnosticsHotnessThreshold();
+  if (OptDiag.getHotness() && Threshold &&
+      *OptDiag.getHotness() < *Threshold) {
+    return;
+  }
----------------
You need to add the same code to MachineOptimizationRemarkEmitter::emit() too.


https://reviews.llvm.org/D34867





More information about the llvm-commits mailing list