[PATCH] D82205: InlineCost - method ::print() to allow dump of statistics to non-debug builds
Kirill Naumov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 24 13:35:31 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rGca899bf90aca: [InlineCost] Added InlineCostCallAnalyzer::print() (authored by knaumov).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82205/new/
https://reviews.llvm.org/D82205
Files:
llvm/lib/Analysis/InlineCost.cpp
Index: llvm/lib/Analysis/InlineCost.cpp
===================================================================
--- llvm/lib/Analysis/InlineCost.cpp
+++ llvm/lib/Analysis/InlineCost.cpp
@@ -726,6 +726,10 @@
void dump();
+ // Prints the same analysis as dump(), but its definition is not dependent
+ // on the build.
+ void print();
+
Optional<InstructionCostDetail> getCostDetails(const Instruction *I) {
if (InstructionCostDetailMap.find(I) != InstructionCostDetailMap.end())
return InstructionCostDetailMap[I];
@@ -2168,9 +2172,7 @@
return finalizeAnalysis();
}
-#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
-/// Dump stats about this call's analysis.
-LLVM_DUMP_METHOD void InlineCostCallAnalyzer::dump() {
+void InlineCostCallAnalyzer::print() {
#define DEBUG_PRINT_STAT(x) dbgs() << " " #x ": " << x << "\n"
if (PrintInstructionComments)
F.print(dbgs(), &Writer);
@@ -2189,6 +2191,12 @@
DEBUG_PRINT_STAT(Threshold);
#undef DEBUG_PRINT_STAT
}
+
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
+/// Dump stats about this call's analysis.
+LLVM_DUMP_METHOD void InlineCostCallAnalyzer::dump() {
+ print();
+}
#endif
/// Test that there are no attribute conflicts between Caller and Callee
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82205.273145.patch
Type: text/x-patch
Size: 1250 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200624/4fec99ee/attachment.bin>
More information about the llvm-commits
mailing list