Commit ca899bf9 authored by Kirill Naumov's avatar Kirill Naumov
Browse files

[InlineCost] Added InlineCostCallAnalyzer::print()

For the upcoming changes, we need to have an ability to dump
InlineCostCallAnalyzer info in non-debug builds as well.

Reviewed-By: mtrofin
Differential Revision: https://reviews.llvm.org/D82205
parent 26fd3ffa
......@@ -726,6 +726,10 @@ public:
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 @@ InlineResult CallAnalyzer::analyze() {
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 @@ LLVM_DUMP_METHOD void InlineCostCallAnalyzer::dump() {
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment